libansilove

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

commit b303c3716547babcea286f54be76994eec29ccde
parent 87c1ae68d0d159078d7ffef48ff4bed86f7fdade
Author: Frederic Cambus <fred@statdns.com>
Date:   Tue, 11 Sep 2018 21:22:46 +0200

Introduce the ANSI_SEQUENCE_MAX_LENGTH macro, instead of harcoding the value

Diffstat:
Msrc/loaders/ansi.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/loaders/ansi.c b/src/loaders/ansi.c @@ -13,6 +13,8 @@ #define _NETBSD_SOURCE #include "../ansilove.h" +#define ANSI_SEQUENCE_MAX_LENGTH 14 + // Character structure struct ansiChar { int32_t column; @@ -116,7 +118,7 @@ int ansilove_ansi(struct ansilove_ctx *ctx, struct ansilove_options *options) // ANSi sequence if (current_character == 27 && next_character == 91) { - for (ansi_sequence_loop = 0; ansi_sequence_loop < 14; ansi_sequence_loop++) { + for (ansi_sequence_loop = 0; ansi_sequence_loop < ANSI_SEQUENCE_MAX_LENGTH; ansi_sequence_loop++) { ansi_sequence_character = ctx->buffer[loop + 2 + ansi_sequence_loop]; // cursor position