libansilove

Library for converting ANSI, ASCII, and other formats to PNG
Log | Files | Refs | README | LICENSE

commit 10814498bc87e28f138db72f732bf2b2da46c179
parent 09db175083b38621590af0938cdfed527c38997e
Author: Frederic Cambus <fred@statdns.com>
Date:   Fri, 29 Jun 2018 20:50:31 +0200

Unbreak Tundra and XBin loaders

Diffstat:
Msrc/loaders/tundra.c | 6++++--
Msrc/loaders/xbin.c | 6++++--
2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/loaders/tundra.c b/src/loaders/tundra.c @@ -29,8 +29,10 @@ void tundra(struct input *inputFile, struct output *outputFile) memcpy(&tundra_header, inputFile->data+1, 8); // need to add check for "TUNDRA24" string in the header - if (tundra_version != 24) - fputs("\nInput file is not a TUNDRA file.\n\n", stderr); exit(4); + if (tundra_version != 24) { + fputs("\nInput file is not a TUNDRA file.\n\n", stderr); + exit(4); + } // read tundra file a first time to find the image size uint32_t character, background = 0, foreground = 0; diff --git a/src/loaders/xbin.c b/src/loaders/xbin.c @@ -16,8 +16,10 @@ void xbin(struct input *inputFile, struct output *outputFile) const unsigned char *font_data; unsigned char *font_data_xbin = NULL; - if (strncmp((char *)inputFile->data, "XBIN\x1a", 5) != 0) - fputs("\nNot an XBin.\n\n", stderr); exit(4); + if (strncmp((char *)inputFile->data, "XBIN\x1a", 5) != 0) { + fputs("\nNot an XBin.\n\n", stderr); + exit(4); + } int32_t xbin_width = (inputFile->data[6] << 8) + inputFile->data[5]; int32_t xbin_height = (inputFile->data[8] << 8) + inputFile->data[7];