summaryrefslogtreecommitdiffstats
path: root/misc-utils/whereis.c
diff options
context:
space:
mode:
authorKarel Zak2014-07-14 16:03:48 +0200
committerKarel Zak2014-07-14 16:03:48 +0200
commit2fa32bea49992d5adeac2a37a42e97241ee73439 (patch)
treea7df10e2df79e267e51cc858d091cf37a5524018 /misc-utils/whereis.c
parentuuidd.rc: Requires remote_fs (diff)
parentlscpu: avoid double free (diff)
downloadkernel-qcow2-util-linux-2fa32bea49992d5adeac2a37a42e97241ee73439.tar.gz
kernel-qcow2-util-linux-2fa32bea49992d5adeac2a37a42e97241ee73439.tar.xz
kernel-qcow2-util-linux-2fa32bea49992d5adeac2a37a42e97241ee73439.zip
Merge branch 'minor-fixes' of git://github.com/kerolasa/lelux-utiliteetit
* 'minor-fixes' of git://github.com/kerolasa/lelux-utiliteetit: lscpu: avoid double free libsmartcols: avoid variable dereference after release libfdisk: do not do the same thing twice in single if statement whereis: avoid printing uninitialized string setpriv: avoid alloca() use xmalloc() instead dmesg: avoid unnecessary variable assignment fdisk: avoid code duplication mkfs.cramfs: use defined failure name rather than magic value fdformat: match variable and print format types cfdisk: add braces to ensure operation order lscpu: avoid use of bzero() in favor of memset() setterm: remove unnecessary variable cal: remove unnused structure and definition textual: fix some typos
Diffstat (limited to 'misc-utils/whereis.c')
-rw-r--r--misc-utils/whereis.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/misc-utils/whereis.c b/misc-utils/whereis.c
index dc7406b94..62730328c 100644
--- a/misc-utils/whereis.c
+++ b/misc-utils/whereis.c
@@ -408,13 +408,12 @@ static void lookup(const char *pattern, struct wh_dirlist *ls, int want)
int count = 0;
char *wait = NULL, *p;
- DBG(printf("lookup dirs for '%s' (%s)", patbuf, pattern));
-
/* canonicalize pattern -- remove path suffix etc. */
p = strrchr(pattern, '/');
p = p ? p + 1 : (char *) pattern;
strncpy(patbuf, p, PATH_MAX);
patbuf[PATH_MAX - 1] = '\0';
+ DBG(printf("lookup dirs for '%s' (%s)", patbuf, pattern));
p = strrchr(patbuf, '.');
if (p)
*p = '\0';