diff options
-rw-r--r-- | src/string.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/string.c b/src/string.c index b9072d86..24ab9792 100644 --- a/src/string.c +++ b/src/string.c @@ -108,7 +108,10 @@ serd_strtod(const char* str, char** endptr) result *= pow(10, expt * expt_sign); } - *endptr = (char*)s; + if (endptr) { + *endptr = (char*)s; + } + return result * sign; } |