From dac30911a3d69a4c6cd02dd4e774493d465f7e42 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Tue, 8 Jan 2019 10:56:56 +0100 Subject: [PATCH] FIX: remove gcc8.2 warnings --- client/cmdhfmf.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/client/cmdhfmf.c b/client/cmdhfmf.c index d92b2a1d4..985965d72 100644 --- a/client/cmdhfmf.c +++ b/client/cmdhfmf.c @@ -894,9 +894,9 @@ int CmdHF14AMfRestore(const char *Cmd) { uint8_t keyB[40][6]; uint8_t numSectors = 16; uint8_t cmdp = 0; - char keyFilename[FILE_PATH_SIZE]=""; - char dataFilename[FILE_PATH_SIZE]=""; - char szTemp[FILE_PATH_SIZE]=""; + char keyFilename[FILE_PATH_SIZE] = ""; + char dataFilename[FILE_PATH_SIZE] = ""; + char szTemp[FILE_PATH_SIZE-20] = ""; char *fptr; FILE *fdump, *fkeys; @@ -905,7 +905,7 @@ int CmdHF14AMfRestore(const char *Cmd) { case 'h': return usage_hf14_restore(); case 'u': - param_getstr(Cmd, cmdp+1, szTemp, FILE_PATH_SIZE); + param_getstr(Cmd, cmdp+1, szTemp, FILE_PATH_SIZE-20); if(keyFilename[0]==0x00) snprintf(keyFilename, FILE_PATH_SIZE, "hf-mf-%s-key.bin", szTemp); if(dataFilename[0]==0x00) @@ -1280,7 +1280,7 @@ int CmdHF14AMfNestedHard(const char *Cmd) { uint8_t trgkey[6] = {0, 0, 0, 0, 0, 0}; uint8_t cmdp=0; char filename[FILE_PATH_SIZE], *fptr; - char szTemp[FILE_PATH_SIZE]; + char szTemp[FILE_PATH_SIZE-20]; char ctmp; bool know_target_key = false; @@ -1370,13 +1370,13 @@ int CmdHF14AMfNestedHard(const char *Cmd) { strncpy(filename, fptr, FILE_PATH_SIZE); break; case 'u': - param_getstr(Cmd, cmdp+1, szTemp, FILE_PATH_SIZE); + param_getstr(Cmd, cmdp+1, szTemp, FILE_PATH_SIZE-20); snprintf(filename, FILE_PATH_SIZE, "hf-mf-%s-nonces.bin", szTemp); cmdp++; break; case 'f': - param_getstr(Cmd, cmdp+1, szTemp, FILE_PATH_SIZE); - strncpy(filename, szTemp, FILE_PATH_SIZE); + param_getstr(Cmd, cmdp+1, szTemp, FILE_PATH_SIZE-20); + strncpy(filename, szTemp, FILE_PATH_SIZE-20); cmdp++; break; case 'i':