diff options
author | James Haggerty <james@gruemail.com> | 2023-02-12 20:27:48 +1100 |
---|---|---|
committer | James Haggerty <james@gruemail.com> | 2023-02-12 20:27:48 +1100 |
commit | 192d0b04509e4d77c4e70108062dc9da80489032 (patch) | |
tree | 8b64e95708d46c3c8ba43c39a73ade947c5b61d6 | |
parent | 59ff5492356013196c9c283c8e237b9d2db584a9 (diff) | |
download | Sensor-Watch-192d0b04509e4d77c4e70108062dc9da80489032.tar.gz Sensor-Watch-192d0b04509e4d77c4e70108062dc9da80489032.tar.bz2 Sensor-Watch-192d0b04509e4d77c4e70108062dc9da80489032.zip |
Fix cat command
If we ran into a heap that wasn't filled with '\0', fun things.
-rw-r--r-- | movement/filesystem.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/movement/filesystem.c b/movement/filesystem.c index 2b345eda..97e35455 100644 --- a/movement/filesystem.c +++ b/movement/filesystem.c @@ -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 { |