libansilove

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

commit c2f990a9da71763ab284fb6e4f22771f902991cd
parent 6fb2dc441bcdf6577cecdc134ab4c929d0ce718a
Author: Frederic Cambus <fred@statdns.com>
Date:   Sat, 18 Jan 2020 23:05:53 +0100

Simplify the code around idf_sequence_length.

Diffstat:
Msrc/loaders/icedraw.c | 10++--------
1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/loaders/icedraw.c b/src/loaders/icedraw.c @@ -52,16 +52,10 @@ ansilove_icedraw(struct ansilove_ctx *ctx, struct ansilove_options *options) uint8_t *ptr, *idf_buffer; idf_buffer = malloc(2); - uint16_t idf_data, idf_data_length; - while (loop < ctx->length - IDF_HEADER_LENGTH) { - memcpy(&idf_data, ctx->buffer+loop, 2); - /* RLE compressed data */ - if (idf_data == 1) { - memcpy(&idf_data_length, ctx->buffer+loop+2, 2); - - idf_sequence_length = idf_data_length & 255; + if (ctx->buffer[loop] == 1) { + idf_sequence_length = ctx->buffer[loop+2]; for (idf_sequence_loop = 0; idf_sequence_loop < idf_sequence_length; idf_sequence_loop++) {