diff options
author | Wojtek Kosior <kwojtus@protonmail.com> | 2019-12-28 12:13:22 +0100 |
---|---|---|
committer | Wojtek Kosior <kwojtus@protonmail.com> | 2019-12-28 12:13:22 +0100 |
commit | b2dd2b0507571399723b3fe74bb469bc7e24f8a0 (patch) | |
tree | e71d595ba5996c1411a3abcb61617d118675621e | |
parent | 6c6156c87c08ec06ccaf44ce391a8e25dbf77ea6 (diff) | |
download | rpi-MMU-example-b2dd2b0507571399723b3fe74bb469bc7e24f8a0.tar.gz rpi-MMU-example-b2dd2b0507571399723b3fe74bb469bc7e24f8a0.zip |
another (hopefully last) change to our fs format - use C-style NULL-terminated strings instead of length-padded
-rw-r--r-- | makefs.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -30,12 +30,9 @@ int main(int argc, char **argv) " is too big.", argv[i]); uint32_t file_size = fileinfo.st_size; - uint32_t name_size = strlen(argv[i]); + uint32_t name_size = strlen(argv[i]) + 1; - if (fwrite(&name_size, 4, 1, stdout) != 1) - errx(-1, "error writing to stdout"); - - if (printf("%s", argv[i]) != name_size) + if (fwrite(argv[i], 1, name_size, stdout) != name_size) errx(-1, "error writing to stdout"); for (int j = 0; (j + (name_size & 0b11)) & 0b11; j++) |