This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug manual/2920] New: Error in snprintf example
- From: "ceving at web dot de" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 13 Jul 2006 15:07:23 -0000
- Subject: [Bug manual/2920] New: Error in snprintf example
- Reply-to: sourceware-bugzilla at sourceware dot org
The example for snprintf shows how to realloc memory, if the buffer for snprintf
is too small. The first call of snprintf uses the variable "size" as size
argument for snprintf. After that the buffer is reallocated to the size "nchars
+1". But the value of size isn't changed and size is also used in the second
call of snprintf. I think this is wrong, because the second call of snprintf
must use "nchars +1" instead of the variable "size", which contains still the
size of the too small buffer.
--
Summary: Error in snprintf example
Product: glibc
Version: 2.3.6
Status: NEW
Severity: minor
Priority: P2
Component: manual
AssignedTo: roland at gnu dot org
ReportedBy: ceving at web dot de
CC: glibc-bugs at sources dot redhat dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=2920
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.