mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +00:00
Don't rely on <string.h>
This commit is contained in:
parent
0e8e872ebf
commit
54a41d6366
1 changed files with 2 additions and 4 deletions
|
@ -1,17 +1,15 @@
|
||||||
/* This is not a proper strtod() implementation, but sufficient for Python.
|
/* This is not a proper strtod() implementation, but sufficient for Python.
|
||||||
Python won't detect floating point constant overflow, though. */
|
Python won't detect floating point constant overflow, though. */
|
||||||
|
|
||||||
#include <string.h>
|
extern int strlen();
|
||||||
|
|
||||||
extern double atof();
|
extern double atof();
|
||||||
|
|
||||||
/*ARGSUSED*/
|
|
||||||
double
|
double
|
||||||
strtod(p, pp)
|
strtod(p, pp)
|
||||||
char *p;
|
char *p;
|
||||||
char **pp;
|
char **pp;
|
||||||
{
|
{
|
||||||
if (pp)
|
if (pp)
|
||||||
*pp = strchr(p, '\0');
|
*pp = p + strlen(p);
|
||||||
return atof(p);
|
return atof(p);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue