diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-12-22 19:33:38 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-12-22 19:33:38 +1300 |
commit | 50357b8fac3e9f5c5edf8c93cb07faa8122fd155 (patch) | |
tree | e3ae7810faed1c8352c74664e3f89aecfd92c679 /wtf8.c | |
parent | Merge branch 'hotfix/v1.2.1' into develop (diff) | |
download | wtf8-50357b8fac3e9f5c5edf8c93cb07faa8122fd155.tar.gz wtf8-50357b8fac3e9f5c5edf8c93cb07faa8122fd155.zip |
Make some dense code a little less opaque
Diffstat (limited to 'wtf8.c')
-rw-r--r-- | wtf8.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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; |