Re: bin/ln & WARNS=5

"M. Warner Losh" <[email protected]> Mon, 15 Jul 2002 09:22:41 -0600 (MDT)
Newsgroups gmane.os.freebsd.devel.audit
Message-ID <[email protected]>
In message: <[email protected]>
            "Todd C. Miller" <[email protected]> writes:
: In message <[email protected]>
: 	so spake "M. Warner Losh" (imp):
: 
: > snprintf never returns a negative number.  It always returns the
: > number of characters that it would have used to make the string.
: 
: Actually, on Solaris snprintf can return -1 due to an incorrect
: locale-specific format string, although this does not appear to
: be documented.
: 
: And of course, Single Unix used to specify that -1 was returned
: when out of space.
: 
: If you are trying for "extreme portability" you might care.

Which is why snprintf() makes a bad substitute for strlen :-)

Warner

To Unsubscribe: send mail to [email protected]
with "unsubscribe freebsd-audit" in the body of the message