1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

check_uri_file(): use strcspn().

This commit is contained in:
Laurent MONIN 2006-01-08 19:06:46 +01:00 committed by Jonas Fonseca
parent b4edfc977d
commit 857138d391

View File

@ -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. */