Re: bin/ln & WARNS=5

"M. Warner Losh" <[email protected]> Mon, 15 Jul 2002 11:09:11 -0600 (MDT)
Newsgroups gmane.os.freebsd.devel.audit
Message-ID <[email protected]>
In message: <[email protected]>
            Mike Barcroft <[email protected]> writes:
: > The code was right before.  However, maybe the following is better and
: > clearer:
: > 
: > 	if (strlen(source) + strlen(p) + 1 >= PATH_MAX) {
: > 		... ETOOLONG stuff
: > 	}	
: > 	snprintf(...);
: 
: You might just as well use sprintf() at this point.

sprintf is considered harmful, and using snprintf specifically shows
that you've 'fixed' that and it doesn't need to be 'audited'.

Warner

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