[cairo-commit] 2 commits - src/cairo-tag-attributes.c
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Jul 23 09:51:26 UTC 2021
src/cairo-tag-attributes.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 014707b7bc05b8766268316351c89b330058bf1c
Merge: e5e63a046 6f64682ca
Author: Adrian Johnson <ajohnson at redneon.com>
Date: Fri Jul 23 09:51:24 2021 +0000
Merge branch 'parse-float-errors' into 'master'
Handle _cairo_strtod() failures in parse_float()
See merge request cairo/cairo!205
commit 6f64682ca0b61d9c40c2fb4420b8b69c6891366c
Author: Uli Schlachter <psychon at znc.in>
Date: Wed Jul 21 17:16:00 2021 +0200
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 at znc.in>
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 {
More information about the cairo-commit
mailing list