Skip to content

Commit c7dd348

Browse files
committed
Convert pystrtod.c
1 parent 95d6c52 commit c7dd348

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Python/pystrtod.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -1239,7 +1239,8 @@ format_float_short(double d, char format_code,
12391239
/* Now that we've done zero padding, add an exponent if needed. */
12401240
if (use_exp) {
12411241
*p++ = float_strings[OFS_E][0];
1242-
exp_len = sprintf(p, "%+.02d", exp);
1242+
/* See `bufsize` comments for the size argument. */
1243+
exp_len = PyOS_snprintf(p, 5, "%+.02d", exp);
12431244
p += exp_len;
12441245
}
12451246
exit:

0 commit comments

Comments
 (0)