summaryrefslogtreecommitdiffstats
path: root/Python/marshal.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1994-08-30 08:27:36 (GMT)
committerGuido van Rossum <guido@python.org>1994-08-30 08:27:36 (GMT)
commit1d5735e84621a7fe68d361fa0e289fa2c3310836 (patch)
tree4ee6f32fa4743f4c6641b04131e449bc71a5ea25 /Python/marshal.c
parent013142a95fd63a05d09cec7b36b7c86cc98e30c1 (diff)
downloadcpython-1d5735e84621a7fe68d361fa0e289fa2c3310836.zip
cpython-1d5735e84621a7fe68d361fa0e289fa2c3310836.tar.gz
cpython-1d5735e84621a7fe68d361fa0e289fa2c3310836.tar.bz2
Merge back to main trunk
Diffstat (limited to 'Python/marshal.c')
-rw-r--r--Python/marshal.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/Python/marshal.c b/Python/marshal.c
index e61815c..dcb63d2 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -1,5 +1,5 @@
/***********************************************************
-Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
+Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum,
Amsterdam, The Netherlands.
All Rights Reserved
@@ -304,10 +304,8 @@ r_object(p)
case TYPE_FLOAT:
{
- extern double strtod PROTO((const char *, char **));
+ extern double atof PROTO((const char *));
char buf[256];
- double res;
- char *end;
n = r_byte(p);
if (r_string(buf, (int)n, p) != n) {
err_setstr(EOFError,
@@ -315,18 +313,7 @@ r_object(p)
return NULL;
}
buf[n] = '\0';
- errno = 0;
- res = strtod(buf, &end);
- if (*end != '\0') {
- err_setstr(ValueError, "bad float syntax");
- return NULL;
- }
- if (errno != 0) {
- err_setstr(ValueError,
- "float constant too large");
- return NULL;
- }
- return newfloatobject(res);
+ return newfloatobject(atof(buf));
}
case TYPE_STRING: