diff options
-rw-r--r-- | bin2carr/src/main.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/bin2carr/src/main.c b/bin2carr/src/main.c index f2d0569..1185b7f 100644 --- a/bin2carr/src/main.c +++ b/bin2carr/src/main.c | |||
@@ -1,6 +1,7 @@ | |||
1 | #include <getopt.h> | 1 | #include <getopt.h> |
2 | #include <stdio.h> | 2 | #include <stdio.h> |
3 | #include <stdlib.h> | 3 | #include <stdlib.h> |
4 | #include <string.h> | ||
4 | 5 | ||
5 | #include "shorthand.h" | 6 | #include "shorthand.h" |
6 | 7 | ||
@@ -46,6 +47,10 @@ write_array(FILE *file_in, FILE *file_out, char *arr_name, ElemSize elem_size) { | |||
46 | arr_type = "s64"; | 47 | arr_type = "s64"; |
47 | n_elem = 4; | 48 | n_elem = 4; |
48 | break; | 49 | break; |
50 | default: | ||
51 | arr_type = "u8"; | ||
52 | n_elem = 8; | ||
53 | break; | ||
49 | } | 54 | } |
50 | fprintf(file_out, "%s %s[] = {\n", arr_type, arr_name); | 55 | fprintf(file_out, "%s %s[] = {\n", arr_type, arr_name); |
51 | size_t n_read = 0; | 56 | size_t n_read = 0; |
@@ -93,6 +98,10 @@ write_array(FILE *file_in, FILE *file_out, char *arr_name, ElemSize elem_size) { | |||
93 | counter++; | 98 | counter++; |
94 | } | 99 | } |
95 | } while(n_read != 0); | 100 | } while(n_read != 0); |
101 | if (counter != 0) { | ||
102 | fseek(file_out, -1, SEEK_CUR); | ||
103 | fprintf(file_out, "\n"); | ||
104 | } | ||
96 | fprintf(file_out, "};\n"); | 105 | fprintf(file_out, "};\n"); |
97 | } | 106 | } |
98 | 107 | ||