From 311ddd85042170f35736b9491ce952ee51e21db1 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Sat, 28 Dec 2019 12:37:47 +0100 Subject: another hopefully last change to the format - add terminating null-byte at the end of the entire ramfs --- makefs.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/makefs.c b/makefs.c index 90e731c..379e8c5 100644 --- a/makefs.c +++ b/makefs.c @@ -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 #include @@ -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; } -- cgit v1.2.3