aboutsummaryrefslogtreecommitdiff
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 f80b845bc..02f4cc7cc 100644
--- a/networking/netstat.c
+++ b/networking/netstat.c
@@ -228,12 +228,12 @@ static long extract_socket_inode(const char *lname)
228{ 228{
229 long inode = -1; 229 long inode = -1;
230 230
231 if (strncmp(lname, "socket:[", sizeof("socket:[")-1) == 0) { 231 if (is_prefixed_with(lname, "socket:[")) {
232 /* "socket:[12345]", extract the "12345" as inode */ 232 /* "socket:[12345]", extract the "12345" as inode */
233 inode = bb_strtoul(lname + sizeof("socket:[")-1, (char**)&lname, 0); 233 inode = bb_strtoul(lname + sizeof("socket:[")-1, (char**)&lname, 0);
234 if (*lname != ']') 234 if (*lname != ']')
235 inode = -1; 235 inode = -1;
236 } else if (strncmp(lname, "[0000]:", sizeof("[0000]:")-1) == 0) { 236 } else if (is_prefixed_with(lname, "[0000]:")) {
237 /* "[0000]:12345", extract the "12345" as inode */ 237 /* "[0000]:12345", extract the "12345" as inode */
238 inode = bb_strtoul(lname + sizeof("[0000]:")-1, NULL, 0); 238 inode = bb_strtoul(lname + sizeof("[0000]:")-1, NULL, 0);
239 if (errno) /* not NUL terminated? */ 239 if (errno) /* not NUL terminated? */