From owner-cvs-all Fri Jan 5 12:46:31 2001 From owner-cvs-all@FreeBSD.ORG Fri Jan 5 12:46:27 2001 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from scientia.demon.co.uk (scientia.demon.co.uk [212.228.14.13]) by hub.freebsd.org (Postfix) with ESMTP id AB87737B400; Fri, 5 Jan 2001 12:46:20 -0800 (PST) Received: from strontium.scientia.demon.co.uk ([192.168.91.36] ident=root) by scientia.demon.co.uk with esmtp (Exim 3.20 #1) id 14Edjy-00046S-00; Fri, 05 Jan 2001 20:45:34 +0000 Received: (from ben@localhost) by strontium.scientia.demon.co.uk (8.11.1/8.11.1) id f05KjY714602; Fri, 5 Jan 2001 20:45:34 GMT (envelope-from ben) Date: Fri, 5 Jan 2001 20:45:33 +0000 From: Ben Smithurst To: Brian Somers Cc: Matt Dillon , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/usr.bin/apply apply.c Message-ID: <20010105204533.O85794@strontium.scientia.demon.co.uk> References: <200101052027.f05KRHi48955@hak.lan.Awfulhak.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200101052027.f05KRHi48955@hak.lan.Awfulhak.org> Sender: ben@scientia.demon.co.uk Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Brian Somers wrote: >>> Yes, but not portably. The ANSI standard tried to standardize it but >>> the reality is that only snprintf()'s return value is portable. If you >>> try to use the return value from other functions as a count, your code >>> won't be portable. asprintf() *might* be portable too, but nothing else. >> >> Oh hell. In that case I'll probably just make the paragraph about >> snprintf's return value clearer and not touch anything else. > > Except that the paragraph that says > > These functions return the number of characters printed (not including > the trailing `\0' used to end output to strings). > > is wrong :-/ ok, how about I update the paragraph to: These functions return the number of characters printed (not including the trailing `\0' used to end output to strings). However, this is only portable when referring to the snprintf() function; the other functions may have different return conventions on other systems. -- Ben Smithurst / ben@FreeBSD.org / PGP: 0x99392F7D To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message