aboutsummaryrefslogtreecommitdiffstats
path: root/util.c
diff options
context:
space:
mode:
authorNRK <nrk@disroot.org>2022-06-16 15:33:32 +0200
committerGitea <gitea@fake.local>2022-09-05 03:52:51 +0200
commitfbe186e79d2083a7bbd1588b317cd5782bc5ae73 (patch)
tree38bc3d7e0c1d3ecf8fe08360615a671fd1f0fd32 /util.c
parentba39006574776d7fa026c63fce8276378cbdaabb (diff)
downloadnsxiv-fbe186e79d2083a7bbd1588b317cd5782bc5ae73.tar.zst
don't assume positive argc
handle a rare, but possible case of argc being 0, in which case argv[0] would be null. note that both POSIX and ISO C standard allow argc to be 0 and in practice this can be triggered via calling `exec(3)` family of functions with NULL as the first `argv`.
Diffstat (limited to 'util.c')
-rw-r--r--util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util.c b/util.c
index f03fe23..8b164ed 100644
--- a/util.c
+++ b/util.c
@@ -28,7 +28,7 @@
#include <sys/stat.h>
#include <unistd.h>
-const char *progname;
+const char *progname = "nsxiv";
void* emalloc(size_t size)
{