X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=windows%2Fwindow.c;h=bf8d651eb22424056420f391f2bea393e923486f;hb=8da4fa506389910599c59b87ba1b799efd6d3ae1;hp=bf212b9ab267df665327b82dc11ce8c58b398b65;hpb=0348f570771a0412609de947778cad9d5b3dca93;p=PuTTY.git diff --git a/windows/window.c b/windows/window.c index bf212b9a..bf8d651e 100644 --- a/windows/window.c +++ b/windows/window.c @@ -548,8 +548,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) q += 2; conf_set_int(conf, CONF_protocol, PROT_TELNET); p = q; - while (*p && *p != ':' && *p != '/') - p++; + p += host_strcspn(p, ":/"); c = *p; if (*p) *p++ = '\0'; @@ -614,15 +613,15 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) /* * Trim a colon suffix off the hostname if it's there. In - * order to protect IPv6 address literals against this - * treatment, we do not do this if there's _more_ than one - * colon. + * order to protect unbracketed IPv6 address literals + * against this treatment, we do not do this if there's + * _more_ than one colon. */ { - char *c = strchr(host, ':'); + char *c = host_strchr(host, ':'); if (c) { - char *d = strchr(c+1, ':'); + char *d = host_strchr(c+1, ':'); if (!d) *c = '\0'; }