summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Python/mystrtoul.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/Python/mystrtoul.c b/Python/mystrtoul.c
index 6f8e9bd049..46c52b8be9 100644
--- a/Python/mystrtoul.c
+++ b/Python/mystrtoul.c
@@ -128,8 +128,14 @@ int base;
temp = result;
result = result * base + c;
#ifndef MPW
- if ((result - c) / base != temp) /* overflow */
- ovf = 1;
+ if(base == 10) {
+ if(((long)(result - c) / base != temp)) /* overflow */
+ ovf = 1;
+ }
+ else {
+ if ((result - c) / base != temp) /* overflow */
+ ovf = 1;
+ }
#endif
str++;
}