mirror of
https://github.com/python/cpython.git
synced 2025-07-29 14:15:07 +00:00
Explicitly add stdio.h and string.h to make strtod.c work standalone.
Found using Clang's static analyzer.
This commit is contained in:
parent
c33e82d23c
commit
0b64be2389
1 changed files with 9 additions and 6 deletions
|
@ -1,3 +1,6 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "pyconfig.h"
|
#include "pyconfig.h"
|
||||||
|
|
||||||
/* comp.sources.misc strtod(), as posted in comp.lang.tcl,
|
/* comp.sources.misc strtod(), as posted in comp.lang.tcl,
|
||||||
|
@ -77,7 +80,7 @@ double strtod(char *str, char **ptr)
|
||||||
dp = buffer;
|
dp = buffer;
|
||||||
*dp++ = '0'; *dp++ = '.';
|
*dp++ = '0'; *dp++ = '.';
|
||||||
buforg = dp, buflim = buffer+48;
|
buforg = dp, buflim = buffer+48;
|
||||||
for (save = sp; c = *sp; sp++)
|
for (save = sp; (c = *sp); sp++)
|
||||||
if (c == '.') {
|
if (c == '.') {
|
||||||
if (dotseen) break;
|
if (dotseen) break;
|
||||||
dotseen++;
|
dotseen++;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue