aboutsummaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorNRK <nrk@disroot.org>2022-06-17 22:16:37 +0600
committerGitea <gitea@fake.local>2022-06-25 08:27:01 +0200
commit5c3a796e55a2de822692810d0ac77c6589b0f10e (patch)
tree8206a8778e30860b74cc9f3d496d9235f8c1c6ec /util.c
parent4cf17d23492a4673a2c6addfa82e61c2117be003 (diff)
[ci]: slience some clang-tidy warnings
the warnings on r_readdir(), img_load_gif() and strcpy seems to be false positives. the warning about fmt being unused is valid, but not worth fixing with additional #ifdef guards. use `assert` to silence the false positive cases when possible, otherwise use a NOLINT comment with an explanation.
Diffstat (limited to 'util.c')
-rw-r--r--util.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/util.c b/util.c
index 48bf61e..9c97dda 100644
--- a/util.c
+++ b/util.c
@@ -19,6 +19,7 @@
#include "nsxiv.h"
+#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
@@ -178,6 +179,7 @@ char* r_readdir(r_dir_t *rdir, bool skip_dotfiles)
if (rdir->recursive && rdir->stlen > 0) {
/* open next subdirectory */
+ assert(rdir->dir != NULL);
closedir(rdir->dir);
if (rdir->d != 0)
free(rdir->name);