From 45994302f232fc4b13fde1b85f512f9238d36613 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Tue, 28 Jul 2015 18:06:46 +0200 Subject: vis: fix one more coverity scan warning With the current code this will never cause a NULL dereference since it is checked at the call site. However it makes sense to check it anyway. --- vis.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vis.c') diff --git a/vis.c b/vis.c index 5181d92..f630e7f 100644 --- a/vis.c +++ b/vis.c @@ -1683,8 +1683,8 @@ static bool cmd_set(Filerange *range, enum CmdOpt cmdopt, const char *argv[]) { } static bool is_file_pattern(const char *pattern) { - return strcmp(pattern, ".") == 0 || strchr(pattern, '*') || - strchr(pattern, '[') || strchr(pattern, '{'); + return pattern && (strcmp(pattern, ".") == 0 || strchr(pattern, '*') || + strchr(pattern, '[') || strchr(pattern, '{')); } static const char *file_open_dialog(const char *pattern) { -- cgit v1.2.3