X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/59f726c989e93a7a29fd23a442bd173839bfc845..300bb58ac13c6f52ad7070fe420305db80cbc30e:/client/util.c?ds=sidebyside diff --git a/client/util.c b/client/util.c index 374ae397..e80f5cc9 100644 --- a/client/util.c +++ b/client/util.c @@ -8,6 +8,7 @@ // utilities //----------------------------------------------------------------------------- +#include #include "util.h" #define MAX_BIN_BREAK_LENGTH (3072+384+1) @@ -581,3 +582,12 @@ void rol(uint8_t *data, const size_t len){ } data[len-1] = first; } + + +// Replace unprintable characters with a dot in char buffer +void clean_ascii(unsigned char *buf, size_t len) { + for (size_t i = 0; i < len; i++) { + if (!isprint(buf[i])) + buf[i] = '.'; + } +}