From 913ce62cfc78043973190b37f1bc2a7c37c15927 Mon Sep 17 00:00:00 2001 From: aiju Date: Sun, 28 Aug 2016 01:08:26 +0200 Subject: [PATCH] strtomp: update the returned char* even if there were no characters parsed --- sys/src/libmp/port/strtomp.c | 6 +++--- 1 file 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); }