]> cvs.zerfleddert.de Git - proxmark3-svn/blobdiff - client/util.c
Merge pull request #227 from pwpiwi/client_fixes
[proxmark3-svn] / client / util.c
index 374ae397a3415d9b8c916cc3573357c36193e89c..e80f5cc9d59efeb7fe1cabee909db4bcb49ed1d5 100644 (file)
@@ -8,6 +8,7 @@
 // utilities
 //-----------------------------------------------------------------------------
 
 // utilities
 //-----------------------------------------------------------------------------
 
+#include <ctype.h>
 #include "util.h"
 #define MAX_BIN_BREAK_LENGTH   (3072+384+1)
 
 #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;
 }
     }
     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] = '.';
+  }
+}
Impressum, Datenschutz