[Python-checkins] Drop confusing commented out code in pystrtod.c (GH-6072) (GH-9586)
Victor Stinner
webhook-mailer at python.org
Wed Sep 26 10:45:24 EDT 2018
https://github.com/python/cpython/commit/b54fc15e32a9faed9398ac8442728756cbbba89a
commit: b54fc15e32a9faed9398ac8442728756cbbba89a
branch: 3.7
author: Victor Stinner <vstinner at redhat.com>
committer: GitHub <noreply at github.com>
date: 2018年09月26日T07:45:19-07:00
summary:
Drop confusing commented out code in pystrtod.c (GH-6072) (GH-9586)
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)
files:
M Python/pystrtod.c
diff --git a/Python/pystrtod.c b/Python/pystrtod.c
index 141a47a8999c..461e8dcb5e0c 100644
--- a/Python/pystrtod.c
+++ b/Python/pystrtod.c
@@ -1062,8 +1062,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; */
Py_UNREACHABLE();
}
goto exit;
More information about the Python-checkins
mailing list