What the OP is on about
:
from the same C-99 standard (what POSIX uses)
Quote:
The snprintf function returns the number of characters that would have been written
had n been sufficiently large, not counting the terminating null character, or a neg ative
value if an encoding error occurred. Thus, the null-terminated output has been
completely written if and only if the returned value is nonnegative and less than n.
|
So you have to check the return code of snprintf to know if it worked correctly.
You should check return codes no matter how stupid it seems. If you use gcc then
Code:
gcc -Wall <filename.c>
or use lint on your code. The only acceptable compile is a completely clean one.