diff options
author | David Robillard <d@drobilla.net> | 2012-03-01 05:39:18 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-03-01 05:39:18 +0000 |
commit | fd3eaa93bde291707405968491ba9a9ab32e41ca (patch) | |
tree | 8a17cc1053f4c5a137e0074dc07b60904e82bb27 /src | |
parent | 79545ea09d2d07012ab0a88fb0a7457999d97afa (diff) | |
download | serd-fd3eaa93bde291707405968491ba9a9ab32e41ca.tar.gz serd-fd3eaa93bde291707405968491ba9a9ab32e41ca.tar.bz2 serd-fd3eaa93bde291707405968491ba9a9ab32e41ca.zip |
Tolerate NULL endptr in serd_strtod.
git-svn-id: http://svn.drobilla.net/serd/trunk@327 490d8e77-9747-427b-9fa3-0b8f29cee8a0
Diffstat (limited to 'src')
-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; } |