]> granicus.if.org Git - python/commitdiff
Fix strncpy warning with gcc 8 (#5840)
authorSiddhesh Poyarekar <siddhesh.poyarekar@gmail.com>
Tue, 6 Mar 2018 10:34:35 +0000 (16:04 +0530)
committerXiang Zhang <angwerzx@126.com>
Tue, 6 Mar 2018 10:34:35 +0000 (18:34 +0800)
The length in strncpy is one char too short and as a result it leads
to a build warning with gcc 8.  Comment out the strncpy since the
interpreter aborts immediately after anyway.

Python/pystrtod.c

index 9bf936386210382facb71dd12c5b3095aa189e3c..601f7c691edf63dd33181f49d2bcc8e79e79a3c5 100644 (file)
@@ -1060,8 +1060,8 @@ format_float_short(double d, char format_code,
         else {
             /* shouldn't get here: Gay's code should always return
                something starting with a digit, an 'I',  or 'N' */
-            strncpy(p, "ERR", 3);
-            /* p += 3; */
+            /* strncpy(p, "ERR", 3);
+               p += 3; */
             Py_UNREACHABLE();
         }
         goto exit;