X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/7f0d5926362d50ed01ea04af95a1e03777fce47c..3c5fce2ba7d49f3ebea05eed187a9b5ee8189803:/client/cmdcrc.c diff --git a/client/cmdcrc.c b/client/cmdcrc.c index 05365298..27d081b9 100644 --- a/client/cmdcrc.c +++ b/client/cmdcrc.c @@ -8,7 +8,6 @@ // CRC Calculations from the software reveng commands //----------------------------------------------------------------------------- -#include #ifdef _WIN32 # include # include @@ -19,8 +18,8 @@ #include #include -//#include -//#include +#include +#include #include "cmdmain.h" #include "cmdcrc.h" #include "reveng/reveng.h" @@ -44,9 +43,10 @@ int split(char *str, char *arr[MAX_ARGS]){ while(isspace(str[beginIndex])){ ++beginIndex; } - if(str[beginIndex] == '\0') + if(str[beginIndex] == '\0') { break; - endIndex = beginIndex; + } + endIndex = beginIndex; while (str[endIndex] && !isspace(str[endIndex])){ ++endIndex; } @@ -434,9 +434,9 @@ int CmdrevengTestC(const char *Cmd){ char result[30]; int dataLen; char endian = 0; - dataLen = param_getstr(Cmd, cmdp++, inModel); + dataLen = param_getstr(Cmd, cmdp++, inModel, sizeof(inModel)); if (dataLen < 4) return 0; - dataLen = param_getstr(Cmd, cmdp++, inHexStr); + dataLen = param_getstr(Cmd, cmdp++, inHexStr, sizeof(inHexStr)); if (dataLen < 4) return 0; bool reverse = (param_get8(Cmd, cmdp++)) ? true : false; endian = param_getchar(Cmd, cmdp++); @@ -464,7 +464,7 @@ char *SwapEndianStr(const char *inStr, const size_t len, const uint8_t blockSize // takes hex string in and searches for a matching result (hex string must include checksum) int CmdrevengSearch(const char *Cmd){ char inHexStr[50] = {0x00}; - int dataLen = param_getstr(Cmd, 0, inHexStr); + int dataLen = param_getstr(Cmd, 0, inHexStr, sizeof(inHexStr)); if (dataLen < 4) return 0; char *Models[80];