From e1f571e8daa43e935ea177a495c4fa4a0cfea96e Mon Sep 17 00:00:00 2001 From: tharexde Date: Fri, 26 Jun 2020 14:58:08 +0200 Subject: [PATCH] forgot to terminate string variable --- client/src/cmdlfem4x50.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/src/cmdlfem4x50.c b/client/src/cmdlfem4x50.c index d8a6ef53d..1c3af381e 100644 --- a/client/src/cmdlfem4x50.c +++ b/client/src/cmdlfem4x50.c @@ -206,6 +206,7 @@ static void print_result(const em4x50_word_t *words, int fwr, int lwr) { print_bit_table(words[i]); // final result + string[0] = '\0'; sprintf(pstring, "\n word[%i] msb: " _GREEN_("0x"), i); strcat(string, pstring); @@ -223,8 +224,6 @@ static void print_result(const em4x50_word_t *words, int fwr, int lwr) { } PrintAndLogEx(NORMAL,string); - - string[0] = '\0'; } } @@ -677,6 +676,7 @@ static void print_sread_result(PacketResponseNG *resp, const em4x50_data_t *etd) prepare_result(data, etd->address, etd->address, &word); print_result(&word, etd->address, etd->address); + string[0] = '\0'; sprintf(pstring, "\n reading " _GREEN_("ok ")); strcat(string, pstring); @@ -702,6 +702,7 @@ static void print_sread_result(PacketResponseNG *resp, const em4x50_data_t *etd) prepare_result(data, 0, now - 1, &word); print_result(&word, 0, now - 1); + string[0] = '\0'; sprintf(pstring, "\n reading " _GREEN_("ok ")); strcat(string, pstring);