Path: utzoo!attcan!uunet!husc6!uwvax!oddjob!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.unix.questions Subject: Re: Guessing buffer size needed for sprintf beforehand Message-ID: <11525@mimsy.UUCP> Date: 17 May 88 01:44:16 GMT References: <136@insyte.uucp> <7768@ncoast.UUCP> <2190@quacky.mips.COM> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 16 In article <2190@quacky.mips.COM> hitz@mips.COM (David Hitz) writes: >In SYSV printf() returns the number of characters printed, so Jill's >solution works fine without Brandon's gyrations. >In BSD printf() returns the first argument. Close. In SysV, printf, sprintf, fprintf, vprintf, vsprintf, and vfprintf all return the number of characters transferred. In 4.2 and 4.3BSD, printf and fprintf return 0 for success, -1 for error, sprintf returns its first argument, and there are no v*printf routines. The 4BSD lint library pretends that printf and fprintf have no return value. In 4.3-tahoe, printf, sprintf, and fprintf return the number of characters transferred, and unless I convince someone quickly, v*printf are still missing. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris