SVG parse_svg_value : re-initialise result to default value on parsing error

This commit is contained in:
Artem Pavlenko 2021-04-19 09:26:13 +01:00
parent 9901050e14
commit 1568fa3894

View file

@ -275,6 +275,7 @@ double parse_svg_value(T & err_handler, const char* str, bool & is_percent)
x3::lit('%')[apply_percent]), x3::lit('%')[apply_percent]),
x3::space) || (cur != end)) x3::space) || (cur != end))
{ {
val = 0.0;
err_handler.on_error("SVG parse error: failed to parse <number> with value \"" + std::string(str) + "\""); err_handler.on_error("SVG parse error: failed to parse <number> with value \"" + std::string(str) + "\"");
} }
return val; return val;