aboutsummaryrefslogtreecommitdiff
path: root/makefs.c
diff options
context:
space:
mode:
authorWojtek Kosior <kwojtus@protonmail.com>2019-12-28 12:30:48 +0100
committerWojtek Kosior <kwojtus@protonmail.com>2019-12-28 12:30:48 +0100
commit8b80b2a919012560b72405e3e34993b8ad35b82c (patch)
tree259f0b5175a20733ab08f841c02c1511e9cc5661 /makefs.c
parent1168c080af2f2f901a08886b670228a05ce74b77 (diff)
downloadrpi-MMU-example-8b80b2a919012560b72405e3e34993b8ad35b82c.tar.gz
rpi-MMU-example-8b80b2a919012560b72405e3e34993b8ad35b82c.zip
write the same null-padding loop a saner way
Diffstat (limited to 'makefs.c')
-rw-r--r--makefs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/makefs.c b/makefs.c
index c122267..90e731c 100644
--- a/makefs.c
+++ b/makefs.c
@@ -49,7 +49,7 @@ int main(int argc, char **argv)
errx(-1, "error writing to stdout");
// pad with null-bytes until a 4-aligned offset
- for (unsigned int j = 0; (j + (name_size & 0b11)) & 0b11; j++)
+ for (uint32_t j = 0; (j + name_size) & 0b11; j++)
if (putchar('\0'))
errx(-1, "error writing to stdout");
@@ -82,7 +82,7 @@ int main(int argc, char **argv)
}
// again, pad with null-bytes until a 4-aligned offset
- for (int j = 0; (j + (file_size & 0b11)) & 0b11; j++)
+ for (uint32_t j = 0; (j + file_size) & 0b11; j++)
if (putchar('\0'))
errx(-1, "error writing to stdout");
}