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

Function IsAlpha

Libraries/unrar/strfn.cpp:193–196  ·  view source on GitHub ↗

We do not want to cast every signed char to unsigned when passing to isalpha, 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 function.

Source from the content-addressed store, hash-verified

191// If chars are signed, conversion from char to int could generate negative
192// values, resulting in undefined behavior in standard function.
193bool IsAlpha(int ch)
194{
195 return ch>='A' && ch<='Z' || ch>='a' && ch<='z';
196}
197
198
199

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected