summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Smeding <t.j.smeding@uu.nl>2024-07-13 22:40:44 +0200
committerTom Smeding <t.j.smeding@uu.nl>2024-07-13 22:40:44 +0200
commit02bdce5c68c2e0d704d65e371d56f96c307b0db1 (patch)
tree3ba79ea049d6c53b1a8cf71417d57fd4727d630f /src
parentd08c2e38ff1c316e4143d09c52caa5304126f72c (diff)
Fix warning in kat
Diffstat (limited to 'src')
-rw-r--r--src/kat.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/kat.c b/src/kat.c
index bc2bc94..7efa7e1 100644
--- a/src/kat.c
+++ b/src/kat.c
@@ -23,8 +23,10 @@ int entry_kat(int argc, char **argv) {
return 1;
}
- for (size_t i = 0; i < map->sb.st_size; i++) {
- putchar(map->addr[i]);
+ if (map->sb.st_size >= 0) {
+ for (size_t i = 0; i < (size_t)map->sb.st_size; i++) {
+ putchar(map->addr[i]);
+ }
}
close_map(map);