From d92a5007b60e0af7d071ae4da7a2b79c5f4de544 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Tue, 28 Mar 2023 13:41:57 +0200 Subject: telnet: simplify the implementation of str_is_nonascii() There is no need to traverse the string twice. Closes #10852 --- lib/telnet.c | 9 ++++----- 1 file 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; } -- cgit v1.2.1