From c30b41cfe9475860db231c2a03fe2becaf90c4b2 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Wed, 5 Sep 2007 13:43:09 +0300 Subject: [PATCH] Make formatValue() use the bin2hex helper. --- rpmdb/header.c | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/rpmdb/header.c b/rpmdb/header.c index 7eed560..97e7d02 100644 --- a/rpmdb/header.c +++ b/rpmdb/header.c @@ -3163,25 +3163,8 @@ static char * formatValue(headerSprintfArgs hsa, sprintfTag tag, int element) if (val) { need = strlen(val); } else { -#ifdef NOTYET - val = memcpy(xmalloc(count), data, count); -#else - /* XXX format string not used */ - static char hex[] = "0123456789abcdef"; - const char * s = data; - -/*@-boundswrite@*/ - need = 2*count + tag->pad; - val = t = xmalloc(need+1); - while (count-- > 0) { - unsigned int i; - i = *s++; - *t++ = hex[ (i >> 4) & 0xf ]; - *t++ = hex[ (i ) & 0xf ]; - } - *t = '\0'; -/*@=boundswrite@*/ -#endif + val = bin2hex(data, count); + need = strlen(val) + tag->pad; } break; -- 2.7.4