From owner-freebsd-audit Mon Jul 15 8:23:30 2002 Delivered-To: freebsd-audit@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4A4E837B400; Mon, 15 Jul 2002 08:23:29 -0700 (PDT) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5026743E4A; Mon, 15 Jul 2002 08:23:28 -0700 (PDT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.3/8.12.3) with ESMTP id g6FFNM1f007241; Mon, 15 Jul 2002 09:23:22 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 15 Jul 2002 09:22:41 -0600 (MDT) Message-Id: <20020715.092241.18906309.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 From: "M. Warner Losh" 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> X-Mailer: Mew version 2.1 on Emacs 21.1 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message: <200207151514.g6FFE3BI007055@xerxes.courtesan.com> "Todd C. Miller" 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