diff --git a/src/protocol/uri.c b/src/protocol/uri.c index 7538ca92e..45d0e39c3 100644 --- a/src/protocol/uri.c +++ b/src/protocol/uri.c @@ -153,15 +153,7 @@ check_uri_file(unsigned char *name) int i; int namelen = strlen(name); - for (i = 0; i < sizeof(chars) - 1; i++) { - unsigned char *pos = memchr(name, chars[i], namelen); - - if (!pos) continue; - - return pos - name; - } - - return namelen; + return strcspn(name, chars); } /* Encodes URIs without encoding stuff like fragments and query separators. */