Fix parsing of numbers in svg files : the code used obsolete atod instead of strtod and led to numbers in the form 2.5e-4 to make the parsing fail as 'e' was interpreted as the end of the number.
Fixes #5728. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38230 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -142,20 +142,9 @@ PathTokenizer::is_separator(unsigned c) const
|
||||
bool
|
||||
PathTokenizer::parse_number()
|
||||
{
|
||||
char buf[256]; // Should be enough for any number
|
||||
char* buf_ptr = buf;
|
||||
|
||||
// Copy all sign characters
|
||||
while (buf_ptr < buf+255 && *fPath == '-' || *fPath == '+') {
|
||||
*buf_ptr++ = *fPath++;
|
||||
}
|
||||
|
||||
// Copy all numeric characters
|
||||
while (buf_ptr < buf+255 && isNumeric(*fPath)) {
|
||||
*buf_ptr++ = *fPath++;
|
||||
}
|
||||
*buf_ptr = 0;
|
||||
fLastNumber = atof(buf);
|
||||
char* end;
|
||||
fLastNumber = strtod(fPath, &end);
|
||||
fPath = end;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user