// utilities
//-----------------------------------------------------------------------------
+#include <ctype.h>
#include "util.h"
#define MAX_BIN_BREAK_LENGTH (3072+384+1)
}
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] = '.';
+ }
+}