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
67a89e1454
commit
8fe7eb0357
@ -150,18 +150,8 @@ check_uri_file(unsigned char *name)
|
||||
{
|
||||
/* Check POST_CHAR etc ... */
|
||||
static const unsigned char chars[] = POST_CHAR_S "#?";
|
||||
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