MCPcopy Create free account
hub / github.com/abbeycode/UnrarKit / IsDigit

Function IsDigit

Libraries/unrar/strfn.cpp:173–176  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

171// If chars are signed, conversion from char to int could generate negative
172// values, resulting in undefined behavior in standard isdigit.
173bool 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

Callers 15

RestoreMethod · 0.85
SetIsoTextMethod · 0.85
SetAgeTextMethod · 0.85
PrintfPrepareFmtFunction · 0.85
ProcessSwitchMethod · 0.85
ProcessCommandMethod · 0.85
GetExclAttrMethod · 0.85
IsNewStyleRevFunction · 0.85
RestoreMethod · 0.85
SetStoreTimeModeMethod · 0.85
RecVolumesTestFunction · 0.85
IsCommentUnsafeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected