summaryrefslogtreecommitdiff
path: root/lib/if.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/if.c')
-rw-r--r--lib/if.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/if.c b/lib/if.c
index ff5ec50a..2e36eff3 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -74,10 +74,14 @@ if_cmp_func (struct interface *ifp1, struct interface *ifp2)
return res;
/* with identical name part, go to numeric part */
-
p1 += l1;
p2 += l1;
+ if (!*p1)
+ return -1;
+ if (!*p2)
+ return 1;
+
x1 = strtol(p1, &p1, 10);
x2 = strtol(p2, &p2, 10);