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

next in thread | previous in thread | raw e-mail | index | archive | help

In message: <200207151514.g6FFE3BI007055@xerxes.courtesan.com>
            "Todd C. Miller" <Todd.Miller@courtesan.com> writes:
: In message <20020715.090420.83279095.imp@bsdimp.com>
: 	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 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.092241.18906309.imp>