Never pass a signed char to ctype macros like isdigit()
Bug: None Change-Id: I451bb2c1f175a77aefbc8363009bf35a769fe941 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264442 Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org> Commit-Queue: Niels Moller <nisse@webrtc.org> Cr-Commit-Position: refs/heads/main@{#37037}
This commit is contained in:
committed by
WebRTC LUCI CQ
parent
c85e473740
commit
e66b83f8ad
@ -92,7 +92,7 @@ static bool GetServiceTypeAndHostnameFromUri(const std::string& in_str,
|
||||
static bool ParsePort(const std::string& in_str, int* port) {
|
||||
// Make sure port only contains digits. FromString doesn't check this.
|
||||
for (const char& c : in_str) {
|
||||
if (!std::isdigit(c)) {
|
||||
if (!std::isdigit(static_cast<unsigned char>(c))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user