common Util: Skip if there is a space after the dot

Some SVG parsers allow parsing of "0."
If there is a space after the dot, skip to the next step.
This commit is contained in:
JunsuChoi 2022-12-12 15:08:06 +09:00 committed by Hermet Park
parent 4bdb58a8ca
commit 439c918553

View file

@ -140,6 +140,8 @@ float svgUtilStrtof(const char *nPtr, char **endPtr)
} }
val += static_cast<float>(decimalPart) / static_cast<float>(pow10); val += static_cast<float>(decimalPart) / static_cast<float>(pow10);
a = iter; a = iter;
//skip if there is a space after the dot.
if (isspace(*a)) goto success;
} }
//Optional: exponent //Optional: exponent