File tree Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change @@ -142,19 +142,9 @@ bool generate_resource_bundle(void)
142
142
143
143
genf (out , "unsigned char bundle[] = {" );
144
144
size_t row_size = 20 ;
145
- for (size_t row = 0 ; row < bundle .count / row_size ; ++ row ){
145
+ for (size_t i = 0 ; i < bundle .count ; ){
146
146
fprintf (out , " " );
147
- for (size_t col = 0 ; col < row_size ; ++ col ) {
148
- size_t i = row * row_size + col ;
149
- fprintf (out , "0x%02X, " , (unsigned char )bundle .items [i ]);
150
- }
151
- genf (out , "" );
152
- }
153
- size_t remainder = bundle .count %row_size ;
154
- if (remainder > 0 ) {
155
- fprintf (out , " " );
156
- for (size_t col = 0 ; col < remainder ; ++ col ) {
157
- size_t i = bundle .count /row_size * row_size + col ;
147
+ for (size_t col = 0 ; col < row_size && i < bundle .count ; ++ col , ++ i ) {
158
148
fprintf (out , "0x%02X, " , (unsigned char )bundle .items [i ]);
159
149
}
160
150
genf (out , "" );
You can’t perform that action at this time.
0 commit comments