From owner-cvs-all Thu Jan 4 18:27: 2 2001 From owner-cvs-all@FreeBSD.ORG Thu Jan 4 18:26:58 2001 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from rover.village.org (unknown [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id 4028B37B400; Thu, 4 Jan 2001 18:26:57 -0800 (PST) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.11.1/8.11.0) with ESMTP id f052Qtl09664; Thu, 4 Jan 2001 19:26:56 -0700 (MST) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.11.1/8.8.3) with ESMTP id f052Qt149151; Thu, 4 Jan 2001 19:26:55 -0700 (MST) Message-Id: <200101050226.f052Qt149151@harmony.village.org> To: Will Andrews Subject: Re: cvs commit: src/usr.bin/apply apply.c Cc: Brian Somers , Chris Faulhaber , Will Andrews , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org In-reply-to: Your message of "Thu, 04 Jan 2001 21:12:57 EST." <20010104211257.V86630@argon.firepipe.net> References: <20010104211257.V86630@argon.firepipe.net> <200101050206.f0526rB87964@hak.lan.Awfulhak.org> Date: Thu, 04 Jan 2001 19:26:55 -0700 From: Warner Losh Sender: imp@harmony.village.org Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <20010104211257.V86630@argon.firepipe.net> Will Andrews writes: : > s[n]printf() is poorly documented in this area. : : I agree. These functions return the number of characters printed (not including the trailing `\0' used to end output to strings). ... Snprintf() and vsnprintf() will write at most size-1 of the characters printed into the output string (the size'th character then gets the ter- minating `\0'); if the return value is greater than or equal to the size argument, the string was too short and some of the printed characters were discarded. It seems to fairly clearly imply that it will return the number of characters that would have been copied to the string, if it was long enough.... The part after the ';' implies this. I'm not sure how it could be clearer. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message