summaryrefslogtreecommitdiff
path: root/scripts/hexdump.c
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/hexdump.c')
-rw-r--r--scripts/hexdump.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/scripts/hexdump.c b/scripts/hexdump.c
index 3e35105d..20763e5e 100644
--- a/scripts/hexdump.c
+++ b/scripts/hexdump.c
@@ -4,7 +4,7 @@
#include <stdlib.h>
#include <string.h>
-static int zero, string;
+static int string;
static int
hexdump(FILE *fo, FILE *fi)
@@ -48,15 +48,9 @@ main(int argc, char **argv)
return 1;
}
- zero = 0;
string = 0;
optind = 1;
- if (!strcmp(argv[optind], "-0")) {
- ++optind;
- zero = 1;
- }
-
if (!strcmp(argv[optind], "-s")) {
++optind;
string = 1;
@@ -106,19 +100,11 @@ main(int argc, char **argv)
size = ftell(fi);
fseek(fi, 0, SEEK_SET);
- fprintf(fo, "const int fz_%s_size = %d;\n", filename, size + zero);
- fprintf(fo, "const unsigned char fz_%s[] =", filename);
+ fprintf(fo, "const unsigned char _binary_%s_start[%d] =", filename, size);
fprintf(fo, string ? "\n" : " {\n");
hexdump(fo, fi);
- if (!zero)
- {
- fprintf(fo, string ? ";\n" : "};\n");
- }
- else
- {
- /* zero-terminate so we can hexdump text files into C strings */
- fprintf(fo, string ? ";\n" : "0};\n");
- }
+ fprintf(fo, string ? ";\n" : "};\n");
+ fprintf(fo, "const unsigned char _binary_%s_end;\n", filename);
fclose(fi);
}