Skip to content

Commit

Permalink
Bug appneta#385 prevent Coverity copy/paste false positive
Browse files Browse the repository at this point in the history
  • Loading branch information
fklassen committed May 8, 2017
1 parent 07c9b15 commit 7322b8f
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions src/common/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,15 @@ get_interface(interface_list_t *list, const char *alias)

assert(alias);

if (list != NULL) {
ptr = list;

do {
/* check both the alias & name fields */
if (strcmp(alias, ptr->alias) == 0)
return(ptr->name);
ptr = list;

if (strcmp(alias, ptr->name) == 0)
return(ptr->name);
while (ptr) {
/* check both the alias & name fields */
if (strcmp(alias, ptr->alias) == 0 ||
strcmp(alias, ptr->name) == 0)
return(ptr->name);

ptr = ptr->next;
} while (ptr != NULL);
ptr = ptr->next;
}

return(NULL);
Expand Down

0 comments on commit 7322b8f

Please sign in to comment.