mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-08 20:48:03 +02:00
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 b7d67433b7, 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>
This commit is contained in:
parent
ab82549f03
commit
6f64682ca0
1 changed files with 1 additions and 1 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue