Path: utzoo!attcan!uunet!samsung!sdd.hp.com!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.unix.questions Subject: Re: stdio.h & sprintf question Message-ID: <13081@smoke.BRL.MIL> Date: 8 Jun 90 21:01:23 GMT References: Distribution: comp Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 13 In article harkcom@potato.pa.Yokogawa.CO.JP (Alton Harkcom) writes: >char *sprintf(); /* too painful to do right */ This is an artifact from an early implementation of sprintf() that happened to leave the buffer address in the function return register, so some applications eventually started relying on it. On non-BSD systems sprintf() eventually was changed from an accidental void- valued function that happened to act like a char*-valued one to a deliberately int-valued one, along with the rest of the *printf() family. While Berkeley didn't follow this trend for quite a while, because as the comment indicates it would require tracking down all uses in applications and fixing them, I think 4.4BSD plans to track the C standard, which specifies int-valued.