Merge pull request #154 from jzrake/master

Fix parsing of numbers with units ex and em
master
Mikko Mononen 2019-03-08 22:33:32 +02:00 committed by GitHub
commit 7cd94e3191
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -1130,7 +1130,7 @@ static double nsvg__atof(const char* s)
// Parse optional exponent
if (*cur == 'e' || *cur == 'E') {
int expPart = 0;
long expPart = 0;
cur++; // skip 'E'
expPart = strtol(cur, &end, 10); // Parse digit sequence with sign
if (cur != end) {
@ -1168,7 +1168,7 @@ static const char* nsvg__parseNumber(const char* s, char* it, const int size)
}
}
// exponent
if (*s == 'e' || *s == 'E') {
if ((*s == 'e' || *s == 'E') && (s[1] != 'm' && s[1] != 'x')) {
if (i < last) it[i++] = *s;
s++;
if (*s == '-' || *s == '+') {