X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/ec9c71129f67c5b1c2429dbaefe23e0d19149780..f4329b17322acc5d12ff8a931478c9c7c6fd0677:/client/util.c diff --git a/client/util.c b/client/util.c index 0a92f15a..38dd3a12 100644 --- a/client/util.c +++ b/client/util.c @@ -193,13 +193,14 @@ char *sprint_hex_ascii(const uint8_t *data, const size_t len) { static char buf[1024]; char *tmp = buf; memset(buf, 0x00, 1024); - size_t max_len = (len > 1010) ? 1010 : len; - + size_t max_len = (len > 255) ? 255 : len; + // max 255 bytes * 3 + 2 characters = 767 in buffer sprintf(tmp, "%s| ", sprint_hex(data, max_len) ); size_t i = 0; size_t pos = (max_len * 3)+2; - while(i < max_len){ + // add another 255 characters ascii = 1020 characters of buffer used + while(i < max_len) { char c = data[i]; if ( (c < 32) || (c == 127)) c = '.';