mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-07-07 13:41:18 -07:00
make clean_ascii a util function
This commit is contained in:
parent
4bbf5ad17d
commit
d172c17ca4
3 changed files with 14 additions and 7 deletions
|
@ -8,6 +8,7 @@
|
|||
// utilities
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include <ctype.h>
|
||||
#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] = '.';
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue