sprintf(3s) query
Richard A. O'Keefe
ok at quintus.uucp
Wed Dec 14 16:47:54 AEST 1988
In article <8131 at ihlpl.ATT.COM> knudsen at ihlpl.ATT.COM (Knudsen) writes:
>Funny you should mention Sun and sprintf(). I have just
>learned the hard way that while most (???) C systems
>have sprintf return the number of characters written,
>the Sun version returns the buffer address!
>Let's hear it for STANDARD I/O Libraries!
yes, let's. SunOS was originally based on 4.2BSD, and 4.2BSD sprintf()
returns the buffer address. Why is that? Because Berkeley ***DIDN'T***
change it! AT&T changed the "standard" library!
And while we're bashing Sun, let's note that they are so unprincipled
that they provide the System V behaviour if you want it. Just compile
your programs with /usr/5bin/cc. What villains! (Heavy irony.)
More information about the Comp.lang.c
mailing list