From dc71ce36c243b108d4def475c5925d62b3f2d5e6 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 15 Dec 2016 20:30:19 +1300 Subject: 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 --- wtf8.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/wtf8.c b/wtf8.c index 3e09808..0b8f3a8 100644 --- a/wtf8.c +++ b/wtf8.c @@ -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 -- cgit v1.2.3