Guessing buffer size needed for sprintf beforehand
    Chris Torek 
    chris at mimsy.UUCP
       
    Tue May 17 11:44:16 AEST 1988
    
    
  
In article <2190 at quacky.mips.COM> hitz at 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 at mimsy.umd.edu	Path:	uunet!mimsy!chris
    
    
More information about the Comp.unix.questions
mailing list