[OpenAFS] sprintf -> snprintf...

Russ Allbery rra@stanford.edu
Thu, 26 Jun 2003 10:36:04 -0700


Jim Rees <rees@umich.edu> writes:

> There is already a snprintf.c in src/util.  Comments there indicate that
> some vendors' versions are broken.

If you want C99 semantics (returning the length of the formatted text
rather than -1 if the buffer is too long and supporting a buffer of NULL
with a length of 0 to just size the string), *most* vendors' versions are
broken.  Linux is right, and it's nearly alone.  (I think *BSD is also
okay.)

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>