This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug manual/2920] New: Error in snprintf example


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]