summaryrefslogtreecommitdiff
path: root/sys/src
diff options
context:
space:
mode:
authoraiju <devnull@localhost>2016-08-28 01:08:26 +0200
committeraiju <devnull@localhost>2016-08-28 01:08:26 +0200
commit913ce62cfc78043973190b37f1bc2a7c37c15927 (patch)
treef871c93c4b0824edee8ebe624a5082ea4feac8a6 /sys/src
parent261ec9fe0e0b2dbde909da79a93e90220a9ea62c (diff)
strtomp: update the returned char* even if there were no characters parsed
Diffstat (limited to 'sys/src')
-rw-r--r--sys/src/libmp/port/strtomp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/src/libmp/port/strtomp.c b/sys/src/libmp/port/strtomp.c
index 51d462101..b0b7d2898 100644
--- a/sys/src/libmp/port/strtomp.c
+++ b/sys/src/libmp/port/strtomp.c
@@ -240,13 +240,13 @@ strtomp(char *a, char **pp, int base, mpint *b)
return nil;
}
+ if(pp != nil)
+ *pp = e;
+
// if no characters parsed, there wasn't a number to convert
if(e == a)
return nil;
- if(pp != nil)
- *pp = e;
-
b->sign = sign;
return mpnorm(b);
}