Open r-barnes opened 4 months ago
Is there supposed to be a fallthrough on this line?
*endptr = s++; switch (**endptr) { case '-': if (!isdigit(*s) && *s != '.') { *endptr = s; return JSON_BAD_NUMBER; } // Should I fallthrough here? case '0': case '1': case '2': case '3':
Yes. Then call to string2double(*endptr...) where '-' handled properly. This cases [-0-9] for parsing numbers
[-0-9]
Thanks, @vivkin . I've put up #41 to make the fallthrough explicit (works for C++17 and up).
Is there supposed to be a fallthrough on this line?