Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions include/xml2json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ static bool xml2json_has_digits_only(const char * input, bool *hasDecimal)
const char * runPtr = input;

*hasDecimal = false;


//Check for negative number
if (*runPtr == '-')
{
runPtr++;
}

while (*runPtr != '\0')
{
if (*runPtr == '.')
Expand All @@ -57,7 +63,7 @@ static bool xml2json_has_digits_only(const char * input, bool *hasDecimal)
else
return false; // we found two dots - not a number
}
else if (isalpha(*runPtr))
else if (!isdigit(*runPtr))
{
return false;
}
Expand Down