Fix wrong isdigit usage.

This commit is contained in:
Martín Lucas Golini
2024-10-20 14:04:35 -03:00
parent 6c413995ae
commit b9d8f365aa
2 changed files with 2 additions and 4 deletions

View File

@@ -518,11 +518,10 @@ Ftp::Response Ftp::DataChannel::setup( Ftp::TransferMode mode ) {
Uint8 data[6] = {0, 0, 0, 0, 0, 0};
std::string str = response.getMessage().substr( begin );
std::size_t index = 0;
std::locale loc;
for ( int i = 0; i < 6; ++i ) {
// Extract the current number
while ( std::isdigit( str[index], loc ) ) {
while ( std::isdigit( str[index] ) ) {
data[i] = data[i] * 10 + ( str[index] - '0' );
index++;
}

View File

@@ -494,10 +494,9 @@ void Http::Response::parse( const std::string& data ) {
std::string version;
if ( in >> version ) {
std::locale loc;
if ( ( version.size() >= 8 ) && ( version[6] == '.' ) &&
( String::toLower( version.substr( 0, 5 ) ) == "http/" ) &&
std::isdigit( version[5], loc ) && std::isdigit( version[7], loc ) ) {
std::isdigit( version[5] ) && std::isdigit( version[7] ) ) {
mMajorVersion = version[5] - '0';
mMinorVersion = version[7] - '0';
} else {