diff options
author | Daniel Stenberg <daniel@haxx.se> | 2002-10-28 21:52:00 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2002-10-28 21:52:00 +0000 |
commit | 01387f42c582fdbebc12cee39ed91346bd42ec04 (patch) | |
tree | e403f027a594ae9f07156214b16a866a1fbc737c /lib/url.c | |
parent | 8f52b731f45eabd5b036b146a27e93ec7fa9e807 (diff) |
kromJx@crosswinds.net's fix that now uses checkprefix() instead of
strnequal() when the third argument was strlen(first argument) anyway.
This makes it less prone to errors. (Slightly edited by me)
Diffstat (limited to 'lib/url.c')
-rw-r--r-- | lib/url.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -1848,22 +1848,22 @@ static CURLcode CreateConnection(struct SessionHandle *data, /* Note: if you add a new protocol, please update the list in * lib/version.c too! */ - if(strnequal(conn->gname, "FTP", 3)) { + if(checkprefix("FTP", conn->gname)) { strcpy(conn->protostr, "ftp"); } - else if(strnequal(conn->gname, "GOPHER", 6)) + else if(checkprefix("GOPHER", conn->gname)) strcpy(conn->protostr, "gopher"); #ifdef USE_SSLEAY - else if(strnequal(conn->gname, "HTTPS", 5)) + else if(checkprefix("HTTPS", conn->gname)) strcpy(conn->protostr, "https"); - else if(strnequal(conn->gname, "FTPS", 4)) + else if(checkprefix("FTPS", conn->gname)) strcpy(conn->protostr, "ftps"); #endif /* USE_SSLEAY */ - else if(strnequal(conn->gname, "TELNET", 6)) + else if(checkprefix("TELNET", conn->gname)) strcpy(conn->protostr, "telnet"); - else if (strnequal(conn->gname, "DICT", sizeof("DICT")-1)) + else if (checkprefix("DICT", conn->gname)) strcpy(conn->protostr, "DICT"); - else if (strnequal(conn->gname, "LDAP", sizeof("LDAP")-1)) + else if (checkprefix("LDAP", conn->gname)) strcpy(conn->protostr, "LDAP"); else { strcpy(conn->protostr, "http"); @@ -1966,7 +1966,7 @@ static CURLcode CreateConnection(struct SessionHandle *data, if(strlen(nope) <= namelen) { char *checkn= conn->name + namelen - strlen(nope); - if(strnequal(nope, checkn, strlen(nope))) { + if(checkprefix(nope, checkn)) { /* no proxy for this host! */ break; } |