diff options
author | David Robillard <d@drobilla.net> | 2016-07-07 23:50:39 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-12-19 08:43:27 -0500 |
commit | 28de6689533914888093d32d3075f58e6f32a4a1 (patch) | |
tree | 961b3e9fc79eabf4003d379fbab4c2404735310b /tests | |
parent | f16313b1c8f559ede8ca47b6b305269a78ea2709 (diff) | |
download | serd-28de6689533914888093d32d3075f58e6f32a4a1.tar.gz serd-28de6689533914888093d32d3075f58e6f32a4a1.tar.bz2 serd-28de6689533914888093d32d3075f58e6f32a4a1.zip |
Make serd_strtod API const-correct
This is an API breakage, but a minor one (particularly since NULL is
allowed) that avoids the flaw in the C API.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/serd_test.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/serd_test.c b/tests/serd_test.c index 04adb560..61a76864 100644 --- a/tests/serd_test.c +++ b/tests/serd_test.c @@ -39,11 +39,12 @@ test_strtod(double dbl, double max_delta) char buf[1024]; snprintf(buf, sizeof(buf), "%f", dbl); - char* endptr = NULL; - const double out = serd_strtod(buf, &endptr); + size_t end = 0; + const double out = serd_strtod(buf, &end); const double diff = fabs(out - dbl); assert(diff <= max_delta); + assert(end == strlen(buf)); } static SerdStatus |