On Thu, Feb 10, 2011 at 2:29 PM, Eduardo Silva <[email protected]> wrote:
>> > There's strlcpy, but it's not in glibc because of possible truncation
>> > errors!
>>
>> Then use a private wrapper.
>>
>
> Here's the new patch:
>
> ----
> [PATCH] Add safe string manipulation functions
>
> Deprecate direct use of strcpy(3)
> The following string manipulation function has been added:
>
>   - string_copy() : wrapper of strcpy(3)
>   - string_ncopy(): wrapper of strncpy(3)
>
> both function compose safe NULL terminated strings.
> ----
>
> I check that the code most of the time raise an error if the path is too
> long, so the new wrappers should be ok...

string_copy seems pointless, it's kinda equivalent to strcpy.
if (!dest || !src) should include an assert so it's easier to break in
the debugger.

-- 
Olaf
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to