summaryrefslogtreecommitdiff
path: root/networking/netstat.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/netstat.c')
-rw-r--r--networking/netstat.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/networking/netstat.c b/networking/netstat.c
index f80b845..02f4cc7 100644
--- a/networking/netstat.c
+++ b/networking/netstat.c
@@ -228,12 +228,12 @@ static long extract_socket_inode(const char *lname)
{
long inode = -1;
- if (strncmp(lname, "socket:[", sizeof("socket:[")-1) == 0) {
+ if (is_prefixed_with(lname, "socket:[")) {
/* "socket:[12345]", extract the "12345" as inode */
inode = bb_strtoul(lname + sizeof("socket:[")-1, (char**)&lname, 0);
if (*lname != ']')
inode = -1;
- } else if (strncmp(lname, "[0000]:", sizeof("[0000]:")-1) == 0) {
+ } else if (is_prefixed_with(lname, "[0000]:")) {
/* "[0000]:12345", extract the "12345" as inode */
inode = bb_strtoul(lname + sizeof("[0000]:")-1, NULL, 0);
if (errno) /* not NUL terminated? */