snprintf and sprintf act differenting when writing to an argument

Ulrich Drepper drepper@cygnus.com
Thu Apr 1 00:00:00 GMT 1999


abakun@reac.com writes:

> >Description: The results of sprintf and snprintf are not the same
> when passing a source string argument that is also the destiniation
> string.  Specificly, when the destination string argument is also
> specified as a source string, sprintf allows this, and snprintf
> clears the destiniation string first.

And your point?  This is completely unspecified.  The implementation
would even be allows to clear the whole output string before writing
to it.

-- 
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------



More information about the Libc-alpha mailing list