aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2015-07-28 18:06:46 +0200
committerMarc André Tanner <mat@brain-dump.org>2015-07-28 18:12:00 +0200
commit45994302f232fc4b13fde1b85f512f9238d36613 (patch)
treec9e0f7c8959d43c27eac935042aa6622d3daf5a0
parenteecd4bdfe422c2afb9cb3bc3fbf375ca81bb99df (diff)
downloadvis-45994302f232fc4b13fde1b85f512f9238d36613.tar.gz
vis-45994302f232fc4b13fde1b85f512f9238d36613.tar.xz
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.
-rw-r--r--vis.c4
1 files changed, 2 insertions, 2 deletions
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) {