aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2018-03-12 09:04:33 -0700
committerRob Landley <rob@landley.net>2018-03-12 14:16:05 -0500
commitf71f8485efbed0ecdd213c4e6d0c9403aa1fcd79 (patch)
tree914c14f4660e928c7ecfac28565b04120c40d6cb /lib
parentfac8b8e6632a2efc5192a1692881c8e00a7d2ba3 (diff)
downloadtoybox-f71f8485efbed0ecdd213c4e6d0c9403aa1fcd79.tar.gz
Fix bug in names_to_pid.
Found by the compiler, not me: lib/lib.c:1053:30: warning: 'st2.st_dev' may be used uninitialized in this function [-Wmaybe-uninitialized] if (st1.st_dev != st2.st_dev || st1.st_ino != st2.st_ino) continue; ~~~^~~~~~~
Diffstat (limited to 'lib')
-rw-r--r--lib/lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/lib.c b/lib/lib.c
index e5c94791..36c2028b 100644
--- a/lib/lib.c
+++ b/lib/lib.c
@@ -1049,7 +1049,7 @@ void names_to_pid(char **names, int (*callback)(pid_t pid, char *name))
char buf[32];
sprintf(buf, "/proc/%u/exe", u);
- if (stat(buf, &st1)) continue;
+ if (stat(buf, &st2)) continue;
if (st1.st_dev != st2.st_dev || st1.st_ino != st2.st_ino) continue;
goto match;
}