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:
Niels Möller
2022-05-30 12:57:41 +02:00
committed by WebRTC LUCI CQ
parent c85e473740
commit e66b83f8ad
13 changed files with 11 additions and 16 deletions

View File

@ -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;
}
}