Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/brpc/http_method.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const char *HttpMethod2Str(HttpMethod method) {
}

bool Str2HttpMethod(const char* method_str, HttpMethod* method) {
const char fc = ::toupper(*method_str);
const char fc = ::toupper(static_cast<unsigned char>(*method_str));
if (fc == 'G') {
if (strcasecmp(method_str + 1, /*G*/"ET") == 0) {
*method = HTTP_METHOD_GET;
Expand Down
4 changes: 2 additions & 2 deletions src/brpc/redis_command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ RedisCommandConsumeState RedisCommandParser::ConsumeImpl(butil::IOBuf& buf,
const auto first_arg = static_cast<char*>(arena->allocate(offset));
memcpy(first_arg, copy_str, offset);
for (size_t i = 0; i < offset; ++i) {
first_arg[i] = tolower(first_arg[i]);
first_arg[i] = tolower(static_cast<unsigned char>(first_arg[i]));
}
_args.push_back(butil::StringPiece(first_arg, offset));
if (offset == crlf_pos) {
Expand Down Expand Up @@ -538,7 +538,7 @@ RedisCommandConsumeState RedisCommandParser::ConsumeImpl(butil::IOBuf& buf,
if (_index == 0) {
// convert it to lowercase when it is command name
for (int i = 0; i < len; ++i) {
d[i] = ::tolower(d[i]);
d[i] = ::tolower(static_cast<unsigned char>(d[i]));
}
}
char crlf[2];
Expand Down
Loading