mirror of
https://github.com/wownero/wownero.git
synced 2026-10-17 07:31:35 +02:00
Merge pull request #11207
1f58e91 epee, common: pass unsigned char to <cctype> functions (pucedoteth)
ACKs: jpk68, Ap4sh, selsta
This commit is contained in:
@@ -662,14 +662,14 @@ namespace net_utils
|
||||
ptr = end + 1;
|
||||
CHECK_AND_ASSERT_MES(epee::misc_utils::parse::isdigit(*ptr), false, "Invalid first response line: " + m_header_cache + ", ptr: " << ptr);
|
||||
ul = strtoul(ptr, &end, 10);
|
||||
CHECK_AND_ASSERT_MES(ul <= INT_MAX && isblank(*end), false, "Invalid first response line: " + m_header_cache + ", ptr: " << ptr);
|
||||
CHECK_AND_ASSERT_MES(ul <= INT_MAX && isblank(static_cast<unsigned char>(*end)), false, "Invalid first response line: " + m_header_cache + ", ptr: " << ptr);
|
||||
m_response_info.m_http_ver_lo = ul;
|
||||
ptr = end + 1;
|
||||
while (isblank(*ptr))
|
||||
while (isblank(static_cast<unsigned char>(*ptr)))
|
||||
++ptr;
|
||||
CHECK_AND_ASSERT_MES(epee::misc_utils::parse::isdigit(*ptr), false, "Invalid first response line: " + m_header_cache);
|
||||
ul = strtoul(ptr, &end, 10);
|
||||
CHECK_AND_ASSERT_MES(ul >= 100 && ul <= 999 && isspace(*end), false, "Invalid first response line: " + m_header_cache);
|
||||
CHECK_AND_ASSERT_MES(ul >= 100 && ul <= 999 && isspace(static_cast<unsigned char>(*end)), false, "Invalid first response line: " + m_header_cache);
|
||||
m_response_info.m_response_code = ul;
|
||||
ptr = end;
|
||||
// ignore the optional text, till the end
|
||||
|
||||
@@ -65,8 +65,8 @@ namespace net_utils
|
||||
std::string hex_to_dec_2bytes(const char *s)
|
||||
{
|
||||
const char *hex = get_hex_vals();
|
||||
int i0 = get_index(hex, toupper(s[0]));
|
||||
int i1 = get_index(hex, toupper(s[1]));
|
||||
int i0 = get_index(hex, toupper(static_cast<unsigned char>(s[0])));
|
||||
int i1 = get_index(hex, toupper(static_cast<unsigned char>(s[1])));
|
||||
if (i0 < 0 || i1 < 0)
|
||||
return std::string("%") + std::string(1, s[0]) + std::string(1, s[1]);
|
||||
return std::string(1, i0 * 16 | i1);
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace tools
|
||||
|
||||
bool alnum = true;
|
||||
for (auto c: fields[3])
|
||||
if (!isalnum(c))
|
||||
if (!isalnum(static_cast<unsigned char>(c)))
|
||||
alnum = false;
|
||||
if (fields[3].size() != 64 && !alnum)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user