diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-10-09 10:03:48 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-10-09 10:03:48 -0400 |
commit | d2c67863777a84ddb759189ab74cc4cdc2a2d234 (patch) | |
tree | 53177ec4e26914e22e833ac0706364252ab325d1 | |
parent | 5801afb48cff83547bccbf214da2b205c9fadcac (diff) | |
download | stasis-indexer-fixups.tar.gz |
Fixes null value when the input path did not existindexer-fixups
-rw-r--r-- | src/stasis_indexer.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/stasis_indexer.c b/src/stasis_indexer.c index b703ec5..8ca7f44 100644 --- a/src/stasis_indexer.c +++ b/src/stasis_indexer.c @@ -762,6 +762,12 @@ int main(int argc, char *argv[]) { int i = 0; while (optind < argc) { + if (argv[optind]) { + if (access(argv[optind], F_OK) < 0) { + fprintf(stderr, "%s: %s\n", argv[optind], strerror(errno)); + exit(1); + } + } // use first positional argument rootdirs[i] = realpath(argv[optind], NULL); optind++; |