We do not want to cast every signed char to unsigned when passing to isdigit, so we implement the replacement. Shall work for Unicode too. If chars are signed, conversion from char to int could generate negative values, resulting in undefined behavior in standard isdigit.
| 171 | // If chars are signed, conversion from char to int could generate negative |
| 172 | // values, resulting in undefined behavior in standard isdigit. |
| 173 | bool IsDigit(int ch) |
| 174 | { |
| 175 | return ch>='0' && ch<='9'; |
| 176 | } |
| 177 | |
| 178 | |
| 179 | // We do not want to cast every signed char to unsigned when passing to |
no outgoing calls
no test coverage detected