From: Karel Zak Date: Fri, 7 Sep 2012 11:34:38 +0000 (+0200) Subject: whereis: improve readability for analysers X-Git-Tag: v2.23-rc1~710 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63beec6443a1b2db215c321870b57ffabf4b4b2e;p=thirdparty%2Futil-linux.git whereis: improve readability for analysers Signed-off-by: Karel Zak --- diff --git a/misc-utils/whereis.c b/misc-utils/whereis.c index 05af8e0b82..ae4cc03286 100644 --- a/misc-utils/whereis.c +++ b/misc-utils/whereis.c @@ -216,7 +216,8 @@ findin(char *dir, char *cp) /* refuse excessively long names */ strcpy(dirbuf, dir); d = strchr(dirbuf, '*'); - *d = 0; + if (d) + *d = 0; dirp = opendir(dirbuf); if (dirp == NULL) return;