mirror of
https://github.com/curl/curl.git
synced 2026-07-26 03:47:17 +03:00
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
1 changed files with 4 additions and 5 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue