diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-12-15 20:30:19 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-12-15 20:30:19 +1300 |
commit | dc71ce36c243b108d4def475c5925d62b3f2d5e6 (patch) | |
tree | caced384601aefa5e3f25b17640db6aae5d00f80 | |
parent | More portability notes (diff) | |
download | wtf8-dc71ce36c243b108d4def475c5925d62b3f2d5e6.tar.gz wtf8-dc71ce36c243b108d4def475c5925d62b3f2d5e6.zip |
Remove - from format string
Doesn't seem to work on OpenBSD, which in retrospect seems like it might
be dodgy; print it or a space explicitly first instead
-rw-r--r-- | wtf8.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -17,11 +17,10 @@ void print_octets(char *s) { /* * Iterate through the string, printing each octet */ - for (; *s; s++) - printf( - is_utf8_cont(*s) ? "-%02x" : " %02x", - (unsigned char) *s - ); + for (; *s; s++) { + putchar(is_utf8_cont(*s) ? '-' : ' '); + printf("%02x", (unsigned char) *s); + } /* * End with a newline |