Skip to content

Commit efd2bac

Browse files
siddheshzhangyangyu
authored andcommitted
Fix strncpy warning with gcc 8 (#5840)
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.
1 parent b9650a0 commit efd2bac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Python/pystrtod.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,8 +1060,8 @@ format_float_short(double d, char format_code,
10601060
else {
10611061
/* shouldn't get here: Gay's code should always return
10621062
something starting with a digit, an 'I', or 'N' */
1063-
strncpy(p, "ERR", 3);
1064-
/* p += 3; */
1063+
/* strncpy(p, "ERR", 3);
1064+
p += 3; */
10651065
Py_UNREACHABLE();
10661066
}
10671067
goto exit;

0 commit comments

Comments
 (0)