]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Drop confusing commented out code in pystrtod.c (GH-6072) (GH-9587)
authorVictor Stinner <vstinner@redhat.com>
Wed, 26 Sep 2018 14:44:45 +0000 (07:44 -0700)
committerGitHub <noreply@github.com>
Wed, 26 Sep 2018 14:44:45 +0000 (07:44 -0700)
Fix the following warning:

Python/pystrtod.c: In function 'format_float_short':
Python/pystrtod.c:1007:13: warning: 'strncpy' output truncated before terminating nul copying 3 bytes from a string of the same length [-Wstringop-truncation]
             strncpy(p, "ERR", 3);

(cherry picked from commit 9fb84157595a385f15799e5d0729c1e1b0ba9d38)

Python/pystrtod.c

index 58278c24be9c280d4cf4b5994f91b924513e0a04..1c635602340a8554dfc4cf7c689504fa254437f3 100644 (file)
@@ -1061,8 +1061,6 @@ 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; */
             assert(0);
         }
         goto exit;