telnet: simplify the implementation of str_is_nonascii()

There is no need to traverse the string twice.

Closes #10852
This commit is contained in:
Kamil Dudka 2023-03-28 13:41:57 +02:00
parent 1903b95e4c
commit d92a5007b6

View File

@ -772,12 +772,11 @@ static void printsub(struct Curl_easy *data,
static bool str_is_nonascii(const char *str) static bool str_is_nonascii(const char *str)
{ {
size_t len = strlen(str); char c;
while(len--) { while((c = *str++))
if(*str & 0x80) if(c & 0x80)
return TRUE; return TRUE;
str++;
}
return FALSE; return FALSE;
} }