diff options
author | Wojtek Kosior <kwojtus@protonmail.com> | 2019-12-28 12:37:47 +0100 |
---|---|---|
committer | Wojtek Kosior <kwojtus@protonmail.com> | 2019-12-28 12:37:47 +0100 |
commit | 311ddd85042170f35736b9491ce952ee51e21db1 (patch) | |
tree | 76055c27c6421d39a3229ad981b8e9a0e729fabb | |
parent | 8b80b2a919012560b72405e3e34993b8ad35b82c (diff) | |
download | rpi-MMU-example-311ddd85042170f35736b9491ce952ee51e21db1.tar.gz rpi-MMU-example-311ddd85042170f35736b9491ce952ee51e21db1.zip |
another hopefully last change to the format - add terminating null-byte at the end of the entire ramfs
-rw-r--r-- | makefs.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -5,7 +5,9 @@ // 4-byte little-endian size of the file and then the contents // of the file and then another null-padding until a 4-aligned offset. // Files encoded this way go one after another (so it's easy to add -// something at the end or at the beginning). +// something at the beginning). +// At the and comes one null-byte (as if a file with empty name +// was there). #include <stdint.h> #include <sys/types.h> @@ -87,6 +89,9 @@ int main(int argc, char **argv) errx(-1, "error writing to stdout"); } + if (putchar('\0')) + errx(-1, "error writing to stdout"); + return 0; } |