From a69eed79501f2e5aba1893574f405e76b7bbe2e4 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sun, 5 Nov 2023 02:11:24 +0100 Subject: [PATCH] fix missing loaded counter --- client/src/fileutils.c | 3 ++- client/src/util.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/client/src/fileutils.c b/client/src/fileutils.c index 1ddb66d74..72850b7fe 100644 --- a/client/src/fileutils.c +++ b/client/src/fileutils.c @@ -1223,12 +1223,13 @@ int loadFileNFC_safe(const char *preferredName, void *data, size_t maxdatalen, s uint8_t block[MFBLOCK_SIZE] = {0}; param_gethex_to_eol(p, 0, block, MFBLOCK_SIZE, &n); memcpy(&udata.bytes[(blockno * MFBLOCK_SIZE)], block, MFBLOCK_SIZE); + counter += MFBLOCK_SIZE; } else if (ft == NFC_DF_PICOPASS) { uint8_t block[PICOPASS_BLOCK_SIZE] = {0}; param_gethex_to_eol(p, 0, block, PICOPASS_BLOCK_SIZE, &n); memcpy(&udata.bytes[(blockno * PICOPASS_BLOCK_SIZE)], block, PICOPASS_BLOCK_SIZE); + counter += PICOPASS_BLOCK_SIZE; } - counter += PICOPASS_BLOCK_SIZE; continue; } } diff --git a/client/src/util.c b/client/src/util.c index 79d3c312b..65e8349da 100644 --- a/client/src/util.c +++ b/client/src/util.c @@ -1200,7 +1200,7 @@ char *str_ndup(const char *src, size_t len) { size_t str_nlen(const char *src, size_t maxlen) { size_t len = 0; - if(src { + if(src) { for(char c = *src; (len < maxlen && c != '\0'); c = *++src) { len++; }