PATCH: safe string copy and concetation

Kaz Kylheku kaz@ashi.footprints.net
Tue Aug 8 19:08:00 GMT 2000


On Tue, 8 Aug 2000, Kaz Kylheku wrote:

> Certainly, strlcpy is easy:
> 
>     #define strlcpy(a, b, c) sprintf(a, "%.*s", b, (int) ((c)-1))
> 
> Did I get that right? The idea is to copy at most c-1 characters from string a

On second reading, no I didn't! The int parameter must precede the char * one.
Oops! :)



More information about the Libc-alpha mailing list