-#include <stdio.h>\r
-#include <stdlib.h>\r
-\r
-int\r
-main(int argc, char **argv)\r
-{\r
- int c;\r
- unsigned int n;\r
- char *name;\r
-\r
- if (argc == 1) {\r
- fprintf(stderr, "bin2char <varname>\n");\r
- fprintf(stderr, "read from standard input and write a char"\r
- " array out to standard output\n");\r
- exit(1);\r
- }\r
-\r
- n = 0;\r
- name = argv[1];\r
- fprintf(stdout, "/* autogenerated from %s */\n", argv[0]);\r
- fprintf(stdout, "unsigned const char %s[] = {\n", name);\r
- while ((c = getc(stdin)) != EOF) {\r
- fprintf(stdout, "0x%02x,", c & 0xff);\r
- if ((++n % 16) == 0)\r
- fprintf(stdout, "\n");\r
- }\r
- fprintf(stdout, "0 /* terminate with a nil */};\n");\r
- fprintf(stdout, "unsigned int %s_len = %u;\n", name, n);\r
- return 0;\r
-}\r
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main(int argc, char **argv)
+{
+ int c;
+ unsigned int n;
+ char *name;
+
+ if (argc == 1) {
+ fprintf(stderr, "bin2char <varname>\n");
+ fprintf(stderr, "read from standard input and write a char"
+ " array out to standard output\n");
+ exit(1);
+ }
+
+ n = 0;
+ name = argv[1];
+ fprintf(stdout, "/* autogenerated from %s */\n", argv[0]);
+ fprintf(stdout, "unsigned const char %s[] = {\n", name);
+ while ((c = getc(stdin)) != EOF) {
+ fprintf(stdout, "0x%02x,", c & 0xff);
+ if ((++n % 16) == 0)
+ fprintf(stdout, "\n");
+ }
+ fprintf(stdout, "0 /* terminate with a nil */};\n");
+ fprintf(stdout, "unsigned int %s_len = %u;\n", name, n);
+ return 0;
+}