summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Dudka <kdudka@redhat.com>2023-03-28 13:41:57 +0200
committerKamil Dudka <kdudka@redhat.com>2023-03-28 15:41:55 +0200
commitd92a5007b60e0af7d071ae4da7a2b79c5f4de544 (patch)
tree24c276cc18c4cf2fe0e65c6bec7cf43382e19ac5
parent1903b95e4c6af7faa150dfd41cdcee879dc44b5b (diff)
downloadcurl-d92a5007b60e0af7d071ae4da7a2b79c5f4de544.tar.gz
telnet: simplify the implementation of str_is_nonascii()
There is no need to traverse the string twice. Closes #10852
-rw-r--r--lib/telnet.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/telnet.c b/lib/telnet.c
index e4ffd853a..0f8483800 100644
--- a/lib/telnet.c
+++ b/lib/telnet.c
@@ -772,12 +772,11 @@ static void printsub(struct Curl_easy *data,
static bool str_is_nonascii(const char *str)
{
- size_t len = strlen(str);
- while(len--) {
- if(*str & 0x80)
+ char c;
+ while((c = *str++))
+ if(c & 0x80)
return TRUE;
- str++;
- }
+
return FALSE;
}