Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Jul 2002 11:09:11 -0600 (MDT)
From:      "M. Warner Losh" <imp@bsdimp.com>
To:        mike@FreeBSD.ORG
Cc:        keramida@FreeBSD.ORG, bde@zeta.org.au, des@ofug.org, freebsd-audit@FreeBSD.ORG
Subject:   Re: bin/ln & WARNS=5
Message-ID:  <20020715.110911.124380985.imp@bsdimp.com>
In-Reply-To: <20020715121958.D64412@espresso.q9media.com>
References:  <20020715111436.GD50130@hades.hell.gr> <20020715.090420.83279095.imp@bsdimp.com> <20020715121958.D64412@espresso.q9media.com>

next in thread | previous in thread | raw e-mail | index | archive | help
In message: <20020715121958.D64412@espresso.q9media.com>
            Mike Barcroft <mike@FreeBSD.org> 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 majordomo@FreeBSD.org
with "unsubscribe freebsd-audit" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020715.110911.124380985.imp>