aboutsummaryrefslogtreecommitdiff
path: root/wtf8.c
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-12-22 19:33:38 +1300
committerTom Ryder <tom@sanctum.geek.nz>2019-12-22 19:33:38 +1300
commit50357b8fac3e9f5c5edf8c93cb07faa8122fd155 (patch)
treee3ae7810faed1c8352c74664e3f89aecfd92c679 /wtf8.c
parentMerge branch 'hotfix/v1.2.1' into develop (diff)
downloadwtf8-50357b8fac3e9f5c5edf8c93cb07faa8122fd155.tar.gz
wtf8-50357b8fac3e9f5c5edf8c93cb07faa8122fd155.zip
Make some dense code a little less opaque
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;