diff options
-rw-r--r-- | env.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -302,8 +302,11 @@ char *visbuf(const char *buf) } else { - (void) sprintf(tp, "\\0x%02x", *buf++); - tp += strlen(tp); + const char hex[] = "0123456789abcdef"; + *tp++ = '\\'; *tp++ = '0'; *tp++ = 'x'; + *tp++ = hex[*buf >> 4]; + *tp++ = hex[*buf & 0xf]; + buf++; } } *tp++ = '\0'; |