diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/kat.c | 3 | ||||
-rw-r--r-- | src/tak.c | 3 |
2 files changed, 6 insertions, 0 deletions
@@ -19,6 +19,9 @@ int entry_kat(int argc, char **argv) { for (int i = 1; i < argc; i++) { const char *fname = argv[i]; struct map *map = open_map(fname); + if (map == NULL) { + return 1; + } for (size_t i = 0; i < map->sb.st_size; i++) { putchar(map->addr[i]); @@ -19,6 +19,9 @@ int entry_tak(int argc, char **argv) { for (int i = argc-1; i >= 1; i--) { const char *fname = argv[i]; struct map *map = open_map(fname); + if (map == NULL) { + return 1; + } char *lstart, *lend; lend = &map->addr[map->sb.st_size - 1]; |