Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

telnet: simplify the implementation of str_is_nonascii() #10852

Closed
wants to merge 1 commit into from

Conversation

kdudka
Copy link
Contributor

@kdudka kdudka commented Mar 28, 2023

There is no need to traverse the string twice.

There is no need to traverse the string twice.
@kdudka kdudka closed this in d92a500 Mar 28, 2023
@pythontech
Copy link

Sorry to necro-post (and I don't have MSVC to hand to check), but couldn't this pragma ugliness be avoided by doing

  while((c = *str++) != '\0')

as is done in inet_pton.c ?

@kdudka
Copy link
Contributor Author

kdudka commented Apr 2, 2023

It could but it is a matter of taste. I do not find it ugly myself at all. The syntax I used is not new in curl code either. You can find it in lib/ftp.c:

while((slashPos = strchr(curPos, '/')))

bch pushed a commit to bch/curl that referenced this pull request Jul 19, 2023
There is no need to traverse the string twice.

Closes curl#10852
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants