summaryrefslogtreecommitdiff
path: root/src/cairo-tag-attributes.c
diff options
context:
space:
mode:
authorUli Schlachter <psychon@znc.in>2021-07-21 17:16:00 +0200
committerUli Schlachter <psychon@znc.in>2021-07-21 17:16:00 +0200
commit6f64682ca0b61d9c40c2fb4420b8b69c6891366c (patch)
treec6b61a81e082fde7c8ead86ff39edc0e0a3494b3 /src/cairo-tag-attributes.c
parentab82549f0344760988844a670133f1ad789b8a89 (diff)
downloadcairo-6f64682ca0b61d9c40c2fb4420b8b69c6891366c.tar.gz
Handle _cairo_strtod() failures in parse_float()
When strtod cannot do anything, it returns zero and sets the end pointer to the beginning of the string. This commit changes the code in parse_float() to treat this case as an error. Without the fix from commit b7d67433b7c0, this commit turns the error from an endless loop into a parse error, which is a lot better error behaviour. Signed-off-by: Uli Schlachter <psychon@znc.in>
Diffstat (limited to 'src/cairo-tag-attributes.c')
-rw-r--r--src/cairo-tag-attributes.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cairo-tag-attributes.c b/src/cairo-tag-attributes.c
index 7977d87f4..dcd970787 100644
--- a/src/cairo-tag-attributes.c
+++ b/src/cairo-tag-attributes.c
@@ -232,7 +232,7 @@ parse_float (const char *p, double *d)
if (has_decimal_point) {
char *end;
*d = _cairo_strtod (start, &end);
- if (end)
+ if (end && end != start)
return end;
} else {