Greg Wooledge <wool...@eeg.ccf.org> writes: > It doesn't mention a null pointer. The OpenBSD man page does explicitly > say the null pointer is allowed if size is zero. The GNU/Linux man page > says that SUSv2 and C99 disagree, but that the implementation follows > C99 (allowing the null pointer when size is 0).
Note that there are more differences between SUSv2 and POSIX.1-2008/C99: The SUSv2 version of snprintf returns the actual number of bytes written (excluding the terminating NUL if any), whereas the C99 version returns the number of bytes that would have been written (excluding the terminating NUL) if the buffer would be big enough. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."