X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/9332b857ffeee343334064d3ca53048f59c55e50..7d5169a0e97575732aa971121193a9eb4f8fae57:/client/cmddata.c diff --git a/client/cmddata.c b/client/cmddata.c index ad86f45f..270b00e6 100644 --- a/client/cmddata.c +++ b/client/cmddata.c @@ -827,19 +827,20 @@ int CmdUndec(const char *Cmd) return 0; } - uint8_t factor = param_get8ex(Cmd, 0,2, 10); + uint8_t factor = param_get8ex(Cmd, 0, 2, 10); //We have memory, don't we? int swap[MAX_GRAPH_TRACE_LEN] = { 0 }; uint32_t g_index = 0 ,s_index = 0; - while(g_index < GraphTraceLen && s_index < MAX_GRAPH_TRACE_LEN) + while(g_index < GraphTraceLen && s_index + factor < MAX_GRAPH_TRACE_LEN) { int count = 0; - for(count = 0; count < factor && s_index+count < MAX_GRAPH_TRACE_LEN; count ++) + for (count = 0; count < factor && s_index + count < MAX_GRAPH_TRACE_LEN; count++) swap[s_index+count] = GraphBuffer[g_index]; - s_index+=count; + s_index += count; + g_index++; } - memcpy(GraphBuffer,swap, s_index * sizeof(int)); + memcpy(GraphBuffer, swap, s_index * sizeof(int)); GraphTraceLen = s_index; RepaintGraphWindow(); return 0; @@ -2325,21 +2326,15 @@ int Cmdbin2hex(const char *Cmd) } int usage_data_hex2bin(){ - - PrintAndLog("Usage: data bin2hex "); + PrintAndLog("Usage: data hex2bin "); PrintAndLog(" This function will ignore all non-hexadecimal characters (but stop reading on whitespace)"); return 0; - } int Cmdhex2bin(const char *Cmd) { int bg =0, en =0; - if(param_getptr(Cmd, &bg, &en, 0)) - { - return usage_data_hex2bin(); - } - + if(param_getptr(Cmd, &bg, &en, 0)) return usage_data_hex2bin(); while(bg <= en ) {