Fix cat command
If we ran into a heap that wasn't filled with '\0', fun things.
This commit is contained in:
parent
59ff549235
commit
192d0b0450
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user