diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-06-14 18:08:43 -0400 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-06-14 18:08:43 -0400 |
commit | 94a70b63cf7f1a9dbfc14fcee8e390791fc17a1b (patch) | |
tree | d1b2bb44621d8c2ebae4a613669eb75e37e507ad /tools/lz/output.c | |
parent | 7f6bc3d3826fe7727bdc8714aa0295a712a548c3 (diff) |
Sync tools with pokecrystal (fixes warnings when building lzcomp)
palette.c and png_dimensions.c will be synced when they are used.
Diffstat (limited to 'tools/lz/output.c')
-rw-r--r-- | tools/lz/output.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/tools/lz/output.c b/tools/lz/output.c index 484a9516..43e7ba92 100644 --- a/tools/lz/output.c +++ b/tools/lz/output.c @@ -28,16 +28,8 @@ void write_commands_and_padding_to_textfile (const char * file, const struct com if (fputs("\tlzend\n", fp) < 0) error_exit(1, "could not write terminator to compressed output"); if (padding_size) { input_stream += padding_offset; - int rv = 0; - unsigned pos; - const char * prefix = "\tdb"; - for (pos = 0; (rv >= 0) && (pos < padding_size); pos ++) { - if (input_stream[pos]) - rv = fprintf(fp, "%s $%02hhx", prefix, input_stream[pos]); - else - rv = fprintf(fp, "%s 0", prefix); - prefix = ","; - } + int rv = fprintf(fp, "\tdb $%02hhx", *(input_stream ++)); + while ((rv >= 0) && (-- padding_size)) rv = fprintf(fp, ", $%02hhx", *(input_stream ++)); if (rv >= 0) rv = -(putc('\n', fp) == EOF); if (rv < 0) error_exit(1, "could not write padding to compressed output"); } |