break;
}
- return !!s && s.ToULong(number);
+ // use the base 10 explicitly because otherwise the string "09" (the
+ // leading zeroes are common in the date specifications) is not parsed
+ // correctly as, according to the standard C rules, it is understood as an
+ // octal number and '9' is not a valid octal digit!
+ return !s.empty() && s.ToULong(number, 10);
}
// scans all alphabetic characters and returns the resulting string
// is it a number?
unsigned long val;
- if ( token.ToULong(&val) )
+ if ( token.ToULong(&val, 10) ) // 10: see comment in GetNumericToken()
{
// guess what this number is