From 63beec6443a1b2db215c321870b57ffabf4b4b2e Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 7 Sep 2012 13:34:38 +0200 Subject: [PATCH] whereis: improve readability for analysers Signed-off-by: Karel Zak --- misc-utils/whereis.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- 2.47.3