diff options
author | Elliott Hughes <enh@google.com> | 2018-03-12 09:04:33 -0700 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2018-03-12 14:16:05 -0500 |
commit | f71f8485efbed0ecdd213c4e6d0c9403aa1fcd79 (patch) | |
tree | 914c14f4660e928c7ecfac28565b04120c40d6cb /lib | |
parent | fac8b8e6632a2efc5192a1692881c8e00a7d2ba3 (diff) | |
download | toybox-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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; } |