]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - windows/winplink.c
Use the new host_str* functions to improve IPv6 literal support.
[PuTTY.git] / windows / winplink.c
index ac7069a2e3fd966e5b8c376e7a06d9d5e411f685..48232b389280fdf9c48f43753ce60bf34f41116d 100644 (file)
@@ -382,8 +382,7 @@ int main(int argc, char **argv)
                        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';
@@ -524,7 +523,7 @@ int main(int argc, char **argv)
        /*
         * Trim off a colon suffix if it's there.
         */
-       host[strcspn(host, ":")] = '\0';
+       host[host_strcspn(host, ":")] = '\0';
 
        /*
         * Remove any remaining whitespace.