diff --git a/src/lib_ccx/ccx_encoders_spupng.c b/src/lib_ccx/ccx_encoders_spupng.c index 87e98323b..232693d28 100644 --- a/src/lib_ccx/ccx_encoders_spupng.c +++ b/src/lib_ccx/ccx_encoders_spupng.c @@ -44,6 +44,7 @@ struct spupng_t #define CCPL (ccfont2_width / CCW * ccfont2_height / CCH) static int initialized = 0; + void spupng_init_font() { uint8_t *t, *p; @@ -138,46 +139,43 @@ void spunpg_free(struct spupng_t *sp) free(sp->relative_path_png); free(sp); } -void sanitize_and_write_comment(FILE *fpxml, const char *input_file) -{ -char sanitized_file[300]; -int j = 0; -for (int i = 0; input_file[i] != '\0' && j < sizeof(sanitized_file) - 1; i++) +void sanitize_and_write_comment(FILE *fpxml, char *input_file) { - if (input_file[i] == '-') - { - if (input_file[i + 1] == '-') - { - sanitized_file[j++] = ' '; - i++; - } - else - { - sanitized_file[j++] = input_file[i]; - } - } - else - { - sanitized_file[j++] = input_file[i]; - } -} - -sanitized_file[j] = '\0'; -fprintf(fpxml, "\n", sanitized_file); + char sanitized_file[300]; + int j = 0; + + for (int i = 0; input_file[i] != '\0' && j < sizeof(sanitized_file) - 1; i++) + { + if (input_file[i] == '-') + { + if (input_file[i + 1] == '-') + { + sanitized_file[j++] = ' '; + i++; + } + else + { + sanitized_file[j++] = input_file[i]; + } + } + else + { + sanitized_file[j++] = input_file[i]; + } + } + + sanitized_file[j] = '\0'; + fprintf(fpxml, "\n", sanitized_file); } void spupng_write_header(struct spupng_t *sp, int multiple_files, char *first_input_file) { -fprintf(sp->fpxml, "\n\n"); - -if (multiple_files) -{ - sanitize_and_write_comment(sp->fpxml, first_input_file); -} + fprintf(sp->fpxml, "\n\n"); + if (multiple_files) + sanitize_and_write_comment(sp->fpxml, first_input_file); } - void spupng_write_footer(struct spupng_t *sp) { fprintf(sp->fpxml, "\n\n");