telnet: simplify the implementation of str_is_nonascii()
There is no need to traverse the string twice. Closes #10852
This commit is contained in:
parent
1903b95e4c
commit
d92a5007b6
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user