aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-04-05 20:37:01 +0200
committerMarc André Tanner <mat@brain-dump.org>2016-04-05 20:40:56 +0200
commit45bd913194a1fcda4760e39772155ae4e3fc6a47 (patch)
tree32be76433de1674d8387dcbd06ad0ec97775b9ad
parent289a9691b3e59453cdbff89e0b41c14e8d0e30b2 (diff)
downloadvis-45bd913194a1fcda4760e39772155ae4e3fc6a47.tar.gz
vis-45bd913194a1fcda4760e39772155ae4e3fc6a47.tar.xz
vis: fix coverity scan warnings
-rw-r--r--main.c2
-rw-r--r--sam.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/main.c b/main.c
index 0b45816..3c7206e 100644
--- a/main.c
+++ b/main.c
@@ -1243,7 +1243,7 @@ static const char *repeat(Vis *vis, const char *keys, const Arg *arg) {
static const char *cursors_new(Vis *vis, const char *keys, const Arg *arg) {
View *view = vis_view(vis);
for (int count = vis_count_get_default(vis, 1); count > 0; count--) {
- Cursor *cursor;
+ Cursor *cursor = NULL;
switch (arg->i) {
case -1:
case +1:
diff --git a/sam.c b/sam.c
index 618db3c..11a6c02 100644
--- a/sam.c
+++ b/sam.c
@@ -1162,7 +1162,7 @@ static bool cmd_cd(Vis *vis, Win *win, Command *cmd, const char *argv[], Cursor
const char *dir = argv[1];
if (!dir)
dir = getenv("HOME");
- return chdir(dir) == 0;
+ return dir && chdir(dir) == 0;
}
#include "vis-cmds.c"