Move length calculation outside loop

svn path=/trunk/netsurf/; revision=12781
This commit is contained in:
John Mark Bell 2011-09-08 21:32:07 +00:00
parent 8f09c239af
commit 46339a296b
1 changed files with 2 additions and 1 deletions

View File

@ -186,12 +186,13 @@ static nserror mimesniff__match_unknown_ws(const uint8_t *data, size_t len,
break;
data++;
len--;
}
if (data == end)
return NSERROR_NOT_FOUND;
len = end - data;
for (it = ws_exact_match_types; it->sig != NULL; it++) {
if (it->len <= len && memcmp(data, it->sig, it->len) == 0) {
*effective_type = lwc_string_ref(*it->type);