Skip to content

Commit

Permalink
Addressed feedback from code review.
Browse files Browse the repository at this point in the history
  • Loading branch information
ragusaa committed Jul 18, 2024
1 parent aa4159b commit b429485
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions libclamav/scanners.c
Original file line number Diff line number Diff line change
Expand Up @@ -2472,25 +2472,19 @@ const char * URI_LIST[] = {

static bool is_url(const char *const str)
{

#define MATCH(str, prefix) \
do { \
if (str && (strlen(str) > strlen(prefix)) && (0 == strncasecmp(str, prefix, strlen(prefix)))) { \
bRet = true; \
goto done; \
} \
} while (0);

bool bRet = false;
size_t i;

for (i = 0; i < sizeof(URI_LIST) / sizeof(URI_LIST[0]); i++) {
MATCH(str, URI_LIST[i]);
if (str && (strlen(str) > strlen(URI_LIST[i])) && (0 == strncasecmp(str, URI_LIST[i], strlen(URI_LIST[i])))) {
bRet = true;
goto done;
}
}
done:
return bRet;
#undef MATCH
}

static void save_urls(cli_ctx *ctx, tag_arguments_t *hrefs, form_data_t *form_data)
{
int i = 0;
Expand Down

0 comments on commit b429485

Please sign in to comment.