Subject: CVS commit: src/lib/libc/stdio
To: None <source-changes@netbsd.org>
From: Krister Walfridsson <kristerw@netbsd.org>
List: source-changes
Date: 01/05/2003 13:05:48
Module Name:	src
Committed By:	kristerw
Date:		Sun Jan  5 11:05:47 UTC 2003

Modified Files:
	src/lib/libc/stdio: snprintf.c vsnprintf.c

Log Message:
Fix two bugs:

1. snprintf(foo, 0. "XXX") is guaranteed not to write in foo by the
   standard (ISO/IEC 9899 7.19.6.5) but our implementation handles this
   as if the buffer has a size of (size_t)-1.

2. snprintf(NULL, 0, "XXX") leaks memory since cantwrite() allocates
   memory if _bf._base == NULL, and this buffer is never freed
   (PR 16483).


To generate a diff of this commit:
cvs rdiff -r1.16 -r1.17 src/lib/libc/stdio/snprintf.c \
    src/lib/libc/stdio/vsnprintf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.