]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR libstdc++/60936 fix length calculation
authorJonathan Wakely <jwakely@redhat.com>
Wed, 20 Sep 2017 12:01:44 +0000 (13:01 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 20 Sep 2017 12:01:44 +0000 (13:01 +0100)
Backport from mainline
2017-02-16  Jonathan Wakely  <jwakely@redhat.com>

PR libstdc++/60936
* src/c++11/snprintf_lite.cc (__concat_size_t): Calculate length
written to buffer, not length remaining in buffer.

Backport from mainline
2017-02-08  Gerald Pfeifer  <gerald@pfeifer.com>

* src/c++11/snprintf_lite.cc (__err): Update bug reporting URL.

From-SVN: r253007

libstdc++-v3/ChangeLog
libstdc++-v3/src/c++11/snprintf_lite.cc

index 1daefa0320eb2efcd74e88954a7b37d441a6ed1c..f803618da6f1b34b8158c54d0475b76b7f7a03c7 100644 (file)
@@ -1,3 +1,17 @@
+2017-09-20  Jonathan Wakely  <jwakely@redhat.com>
+
+       Backport from mainline
+       2017-02-16  Jonathan Wakely  <jwakely@redhat.com>
+
+       PR libstdc++/60936
+       * src/c++11/snprintf_lite.cc (__concat_size_t): Calculate length
+       written to buffer, not length remaining in buffer.
+
+       Backport from mainline
+       2017-02-08  Gerald Pfeifer  <gerald@pfeifer.com>
+
+       * src/c++11/snprintf_lite.cc (__err): Update bug reporting URL.
+
 2017-09-18  Jonathan Wakely  <jwakely@redhat.com>
 
        Backport from mainline
index c3f8dc05917475bc8e1006e3033d20b9762cfe59..2ddcdf353ac3371219e8a7bfdac6a53f5f6677ea 100644 (file)
@@ -52,7 +52,7 @@ namespace __gnu_cxx {
     const size_t __len = __bufend - __buf + 1;
 
     const char __err[] = "not enough space for format expansion "
-      "(Please submit full bug report at http://gcc.gnu.org/bugs.html):\n    ";
+      "(Please submit full bug report at https://gcc.gnu.org/bugs/):\n    ";
     const size_t __errlen = sizeof(__err) - 1;
 
     char *const __e
@@ -81,7 +81,7 @@ namespace __gnu_cxx {
        __val /= 10;
       }
     while (__val != 0);
-    size_t __len = __out - __cs;
+    size_t __len = __cs + __ilen - __out;
     if (__bufsize < __len)
       return -1;