#defines with variable # arguments

Richard A. O'Keefe ok at quintus.UUCP
Sat May 14 19:04:16 AEST 1988


In article <2855 at phoenix.Princeton.EDU>, lgy at pupthy2.PRINCETON.EDU (Larry Yaffe) writes:
>     Does anyone know why the folks at Berkeley chose to have their
> sprintf return its first argument, instead of the number of characters
> printed?  I can't think of any good reason for this choice, since it
> throws away valuable information (the # of characters printed) which
> is painful to reacquire.

Berkeley left sprintf() as they found it; that's what it did in V7.
There is an argument in favour of it: it makes it more like strcpy().
[Not that I think much of it, I've never found the return value of
 strcpy() useful.]  What's so painful about calling strlen()?



More information about the Comp.unix.wizards mailing list