summaryrefslogtreecommitdiff
path: root/rpmdb/header.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2007-09-05 13:43:09 +0300
committerPanu Matilainen <pmatilai@redhat.com>2007-09-05 13:43:09 +0300
commitc30b41cfe9475860db231c2a03fe2becaf90c4b2 (patch)
treefe3b1e7c3e7dda498c78c9de63fe46be6f9e0e63 /rpmdb/header.c
parent1a2426fec6419856211d745ba167cea53befacfd (diff)
downloadlibrpm-tizen-c30b41cfe9475860db231c2a03fe2becaf90c4b2.tar.gz
librpm-tizen-c30b41cfe9475860db231c2a03fe2becaf90c4b2.tar.bz2
librpm-tizen-c30b41cfe9475860db231c2a03fe2becaf90c4b2.zip
Make formatValue() use the bin2hex helper.
Diffstat (limited to 'rpmdb/header.c')
-rw-r--r--rpmdb/header.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/rpmdb/header.c b/rpmdb/header.c
index 7eed56016..97e7d0245 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;