Message ID | 5f0a2388e77ae0388a92505c0a24b4e9d00570fb.1653446538.git.peilin.ye@bytedance.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 2d866c6d93dbf4fe8169dda4a3a8f4a67fa0a5b9 |
Delegated to: | David Ahern |
Headers | show |
Series | ss: Introduce -T, --threads option | expand |
Context | Check | Description |
---|---|---|
netdev/tree_selection | success | Not a local patch |
diff --git a/misc/ss.c b/misc/ss.c index 4b3ca9c4e86b..aa9da7e45e53 100644 --- a/misc/ss.c +++ b/misc/ss.c @@ -621,9 +621,8 @@ static void user_ent_hash_build(void) char *p; int pid, pos; DIR *dir1; - char crap; - if (sscanf(d->d_name, "%d%c", &pid, &crap) != 1) + if (sscanf(d->d_name, "%d%*c", &pid) != 1) continue; if (getpidcon(pid, &pid_context) != 0) @@ -647,7 +646,7 @@ static void user_ent_hash_build(void) ssize_t link_len; char tmp[1024]; - if (sscanf(d1->d_name, "%d%c", &fd, &crap) != 1) + if (sscanf(d1->d_name, "%d%*c", &fd) != 1) continue; snprintf(name+pos, sizeof(name) - pos, "%d", fd);