commit 87c1ae68d0d159078d7ffef48ff4bed86f7fdade
parent 2129dc158b322d9602eea735f16005433a3bb0cb
Author: Frederic Cambus <fred@statdns.com>
Date: Sun, 29 Jul 2018 22:12:41 +0200
Use UINT32_MAX for strtonum() maxval
Diffstat:
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/loaders/ansi.c b/src/loaders/ansi.c
@@ -133,15 +133,15 @@ int ansilove_ansi(struct ansilove_ctx *ctx, struct ansilove_options *options)
seqTok = strtok(seqGrab, ";");
if (seqTok)
- seq_column = strtonum(seqTok, 0, INT32_MAX, &errstr);
+ seq_column = strtonum(seqTok, 0, UINT32_MAX, &errstr);
} else {
seqTok = strtok(seqGrab, ";");
if (seqTok)
- seq_line = strtonum(seqTok, 0, INT32_MAX, &errstr);
+ seq_line = strtonum(seqTok, 0, UINT32_MAX, &errstr);
seqTok = strtok(NULL, ";");
if (seqTok)
- seq_column = strtonum(seqTok, 0, INT32_MAX, &errstr);
+ seq_column = strtonum(seqTok, 0, UINT32_MAX, &errstr);
}
// set the positions
@@ -161,7 +161,7 @@ int ansilove_ansi(struct ansilove_ctx *ctx, struct ansilove_options *options)
seqGrab = strndup((char *)ctx->buffer + loop + 2, ansi_sequence_loop);
// now get escape sequence's position value
- int32_t seq_line = strtonum(seqGrab, 0, INT32_MAX, &errstr);
+ int32_t seq_line = strtonum(seqGrab, 0, UINT32_MAX, &errstr);
free(seqGrab);
row -= seq_line ? seq_line : 1;
@@ -176,7 +176,7 @@ int ansilove_ansi(struct ansilove_ctx *ctx, struct ansilove_options *options)
seqGrab = strndup((char *)ctx->buffer + loop + 2, ansi_sequence_loop);
// now get escape sequence's position value
- int32_t seq_line = strtonum(seqGrab, 0, INT32_MAX, &errstr);
+ int32_t seq_line = strtonum(seqGrab, 0, UINT32_MAX, &errstr);
free(seqGrab);
row += seq_line ? seq_line : 1;
@@ -191,7 +191,7 @@ int ansilove_ansi(struct ansilove_ctx *ctx, struct ansilove_options *options)
seqGrab = strndup((char *)ctx->buffer + loop + 2, ansi_sequence_loop);
// now get escape sequence's position value
- int32_t seq_column = strtonum(seqGrab, 0, INT32_MAX, &errstr);
+ int32_t seq_column = strtonum(seqGrab, 0, UINT32_MAX, &errstr);
free(seqGrab);
column += seq_column ? seq_column : 1;
@@ -209,7 +209,7 @@ int ansilove_ansi(struct ansilove_ctx *ctx, struct ansilove_options *options)
seqGrab = strndup((char *)ctx->buffer + loop + 2, ansi_sequence_loop);
// now get escape sequence's content length
- int32_t seq_column = strtonum(seqGrab, 0, INT32_MAX, &errstr);
+ int32_t seq_column = strtonum(seqGrab, 0, UINT32_MAX, &errstr);
free(seqGrab);
column -= seq_column ? seq_column : 1;
@@ -245,7 +245,7 @@ int ansilove_ansi(struct ansilove_ctx *ctx, struct ansilove_options *options)
seqGrab = strndup((char *)ctx->buffer + loop + 2, ansi_sequence_loop);
// convert grab to an integer
- int32_t eraseDisplayInt = strtonum(seqGrab, 0, INT32_MAX, &errstr);
+ int32_t eraseDisplayInt = strtonum(seqGrab, 0, UINT32_MAX, &errstr);
free(seqGrab);
if (eraseDisplayInt == 2) {
@@ -270,7 +270,7 @@ int ansilove_ansi(struct ansilove_ctx *ctx, struct ansilove_options *options)
seqGrab = strndup((char *)ctx->buffer + loop + 2, ansi_sequence_loop);
while ((seqTok = strtok(seqGrab, ";")) != NULL) {
- seqValue = strtonum(seqTok, 0, INT32_MAX, &errstr);
+ seqValue = strtonum(seqTok, 0, UINT32_MAX, &errstr);
if (seqValue == 0) {
background = 0;