Fix cat command

If we ran into a heap that wasn't filled with '\0', fun things.
This commit is contained in:
James Haggerty 2023-02-12 20:27:48 +11:00
parent 59ff549235
commit 192d0b0450

View File

@ -196,6 +196,7 @@ static void filesystem_cat(char *filename) {
if (info.size > 0) {
char *buf = malloc(info.size + 1);
filesystem_read_file(filename, buf, info.size);
buf[info.size] = '\0';
printf("%s\n", buf);
free(buf);
} else {