You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by se...@apache.org on 2007/07/19 00:29:53 UTC

svn commit: r557418 - /incubator/stdcxx/trunk/tests/src/printf.cpp

Author: sebor
Date: Wed Jul 18 15:29:49 2007
New Revision: 557418

URL: http://svn.apache.org/viewvc?view=rev&rev=557418
Log:
2007-07-18  Martin Sebor  <se...@roguewave.com>

	* printf.cpp (rw_sprintf): Copied the entire string including
	the terminating NUL to the destination buffer.

Modified:
    incubator/stdcxx/trunk/tests/src/printf.cpp

Modified: incubator/stdcxx/trunk/tests/src/printf.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/src/printf.cpp?view=diff&rev=557418&r1=557417&r2=557418
==============================================================================
--- incubator/stdcxx/trunk/tests/src/printf.cpp (original)
+++ incubator/stdcxx/trunk/tests/src/printf.cpp Wed Jul 18 15:29:49 2007
@@ -3339,7 +3339,7 @@
     va_end (va);
 
     if (-1 < nchars)
-        memcpy (buf, tmpbuf, size_t (nchars));
+        memcpy (buf, tmpbuf, size_t (nchars + 1 /* NUL */));
 
     free (tmpbuf);