summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/sourceclean.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/sourceclean.c b/tools/sourceclean.c
new file mode 100644
index 0000000..8fb02c4
--- /dev/null
+++ b/tools/sourceclean.c
@@ -0,0 +1,12 @@
+#include <stdio.h>
+
+int main(int argc, char **argv) {
+ unsigned char c;
+ while (fread(&c, sizeof(c), 1, stdin)) {
+ if (c < 128) {
+ printf("%c", c);
+ } else {
+ printf("\\x%2X", c);
+ }
+ }
+}