commit - de6548b97dff8ce3a011f93e007254cd9f01b8ec
commit + ed84beb94ed56dbc810ebc7323e2458c26287c09
blob - 562a3e3df121754dc8801ec93bc8d12353d82770
blob + 0ae6f24d8ac4d26741ef8894b8152b46a69f5620
--- pagebundler.c
+++ pagebundler.c
/*
* pagebundler converts the given file into a valid C program that can
* be compiled. The generated code provides a variable that holds the
- * original file.
+ * content of the original file and a _len variable with the size.
*
* Usage: pagebundler -f file -v varname > outfile
*/
if ((f = fopen(file, "r")) == NULL) {
fprintf(stderr, "%s: can't open %s: %s",
argv[0], file, strerror(errno));
+ return 1;
}
printf("const uint8_t %s[] = {\n", varname);
break;
}
- len++;
- printf("\t0x00\n");
printf("}; /* %s */\n", varname);
printf("size_t %s_len = %zu;\n", varname, len);