From 6118b11a3eda054ca614a895f1a566dc32ce76fd Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 15 Jun 2022 18:48:36 +0200 Subject: [PATCH] fix proxspace breaking --- client/src/cmddata.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/client/src/cmddata.c b/client/src/cmddata.c index 5653d78b8..3b6aadc05 100644 --- a/client/src/cmddata.c +++ b/client/src/cmddata.c @@ -3073,7 +3073,7 @@ static int CmdDiff(const char *Cmd) { if (diff == 0) { hex_to_buffer((uint8_t *)line, inA + i, width, sizeof(line), 0, 1, true); ascii_to_buffer((uint8_t *)(line + strlen(line)), inA + i, width, width, 0); - strncat(line + strlen(line), " | ", 3); + strncat(line + strlen(line), " | ", sizeof(line) - strlen(line)); hex_to_buffer((uint8_t *)(line + strlen(line)), inB + i, width, sizeof(line), 0, 1, true); ascii_to_buffer((uint8_t *)(line + strlen(line)), inB + i, width, width, 0); } else { @@ -3137,26 +3137,26 @@ static int CmdDiff(const char *Cmd) { memset(line, 0, sizeof(line)); if (tallestA) { - hex_to_buffer((uint8_t *)line, inA + i, width, sizeof(line), 0, 1, true); - ascii_to_buffer((uint8_t *)(line + strlen(line)), inA + i, width, sizeof(line), 0); + hex_to_buffer((uint8_t *)line, inA + i, width, sizeof(line), 0, 1, true); + ascii_to_buffer((uint8_t *)(line + strlen(line)), inA + i, width, sizeof(line), 0); strcat(line + strlen(line), " | "); for (int j = 0; j < width; j++) { - strncat(line + strlen(line), "-- ", 3); + strncat(line + strlen(line), "-- ", sizeof(line) - strlen(line)); } for (int j = 0; j < width; j++) { - strncat(line + strlen(line), ".", 1); + strncat(line + strlen(line), ".", sizeof(line) - strlen(line)); } } else { for (int j = 0; j < width; j++) { - strncat(line + strlen(line), "-- ", 3); + strncat(line + strlen(line), "-- ", sizeof(line) - strlen(line)); } for (int j = 0; j < width; j++) { - strncat(line + strlen(line), ".", 1); + strncat(line + strlen(line), ".", sizeof(line) - strlen(line)); } - strncat(line + strlen(line), " | ", 3); - hex_to_buffer((uint8_t *)(line + strlen(line)), inB + i, width, sizeof(line), 0, 1, true); - ascii_to_buffer((uint8_t *)(line + strlen(line)), inB + i, width, sizeof(line), 0); + strncat(line + strlen(line), " | ", sizeof(line) - strlen(line)); + hex_to_buffer((uint8_t *)(line + strlen(line)), inB + i, width, sizeof(line), 0, 1, true); + ascii_to_buffer((uint8_t *)(line + strlen(line)), inB + i, width, sizeof(line), 0); } PrintAndLogEx(INFO, "%03X | %s", i, line);