aboutsummaryrefslogtreecommitdiff
path: root/wtf8.c
diff options
context:
space:
mode:
Diffstat (limited to 'wtf8.c')
-rw-r--r--wtf8.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/wtf8.c b/wtf8.c
index 714a7cc..7078ec1 100644
--- a/wtf8.c
+++ b/wtf8.c
@@ -18,8 +18,13 @@ void print_octets(char *s) {
/*
* Iterate through the string, printing each octet, ending with a newline
*/
- while ((c = *s++))
- printf("%c%02x", (is_utf8_cont(c) ? '-' : ' '), c);
+ while ((c = *s++)) {
+ char sep;
+ sep = is_utf8_cont(c)
+ ? BYTE_SEP
+ : CHAR_SEP;
+ printf("%c%02x", sep, c);
+ }
putchar('\n');
return;