aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-03-01 05:39:18 +0000
committerDavid Robillard <d@drobilla.net>2012-03-01 05:39:18 +0000
commitfd3eaa93bde291707405968491ba9a9ab32e41ca (patch)
tree8a17cc1053f4c5a137e0074dc07b60904e82bb27 /src
parent79545ea09d2d07012ab0a88fb0a7457999d97afa (diff)
downloadserd-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.c5
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;
}