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:
parent
b4edfc977d
commit
857138d391
@ -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. */
|
||||
|
Loading…
Reference in New Issue
Block a user