Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!purdue!decwrl!sun!quintus!ok From: ok@quintus.uucp (Richard A. O'Keefe) Newsgroups: comp.lang.c Subject: Re: sprintf(3s) query Message-ID: <865@quintus.UUCP> Date: 14 Dec 88 06:47:54 GMT References: <1102@entropy.ms.washington.edu> <8131@ihlpl.ATT.COM> Sender: news@quintus.UUCP Reply-To: ok@quintus.UUCP (Richard A. O'Keefe) Organization: Quintus Computer Systems, Inc. Lines: 13 In article <8131@ihlpl.ATT.COM> knudsen@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.)