summaryrefslogtreecommitdiffstats
path: root/Python/mystrtoul.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/mystrtoul.c')
-rw-r--r--Python/mystrtoul.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/Python/mystrtoul.c b/Python/mystrtoul.c
index 6f8e9bd..46c52b8 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++;
}