diff options
author | Uli Schlachter <psychon@znc.in> | 2021-07-21 17:16:00 +0200 |
---|---|---|
committer | Uli Schlachter <psychon@znc.in> | 2021-07-21 17:16:00 +0200 |
commit | 6f64682ca0b61d9c40c2fb4420b8b69c6891366c (patch) | |
tree | c6b61a81e082fde7c8ead86ff39edc0e0a3494b3 /src/cairo-tag-attributes.c | |
parent | ab82549f0344760988844a670133f1ad789b8a89 (diff) | |
download | cairo-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.c | 2 |
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 { |