diff options
author | Ian Moffett <ian@osmora.org> | 2024-02-16 22:22:58 -0500 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2024-02-16 22:22:58 -0500 |
commit | 93773ef919908b91abcf41c8ccc64347bb67244b (patch) | |
tree | f3dc84efcda995fd23dbfd57c1882891fc42a331 /src/main.c | |
parent | 204517801a33f1bafab3ce1e80f71f41aa5f61a6 (diff) |
Fix read_file() bug
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -62,7 +62,7 @@ read_file(const char *fname, size_t *size_out) size_t bufsize; if (access(fname, F_OK) != 0) { - fprintf(stderr, "%s does not exist!\n"); + fprintf(stderr, "%s does not exist!\n", fname); return NULL; } @@ -217,6 +217,10 @@ main(int argc, const char **argv) #endif /* __x86_64__ */ buf = read_file(argv[1], &buf_size); + if (buf == NULL) { + return 1; + } + encrypt(&info, buf, buf_size); writeback_file(argv[1], buf, buf_size); free(buf); |