From 35f08122fe2f801f067c223b08fe440cda5779ee Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Fri, 12 Nov 2004 21:15:21 +0000 Subject: Replace sprintf. svn path=/trunk/; revision=4004 --- env.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/env.c b/env.c index 516040bd..aaddb54d 100644 --- a/env.c +++ b/env.c @@ -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'; -- cgit v1.2.3