In message <[EMAIL PROTECTED]> Mike Smith writes:
: Ugh.  Take the first example in the paper; it rewrites as
: 
:       len = asprintf(&path, "%s/.foorc");
: 
: as opposed to
: 
:       strlcat(path, homedir, sizeof(path));
:       strlcat(path, "/", sizeof(path));
:       strlcat(path, ".foord", sizeof(path));
:       len = strlen(path);
: 
: Yes, they're a better str*cat/cpy, but they're not the solution that 
: they claim to be.

You've forgotten the free(path) sometime later in your code...  That's
a can of warms you conveniently ignore...  And can be big problems for
library routines whose API is defined to return stuff into a static
buffer...

Warner


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to