summaryrefslogtreecommitdiff
path: root/rpmio
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-04-07 13:29:48 +0300
committerPanu Matilainen <pmatilai@redhat.com>2008-04-07 13:29:48 +0300
commit41a32765bde2cc346bba93da364e7bdeb985fcf9 (patch)
treeaa4318d7dc76a7473f26ad7861614820948d793c /rpmio
parent8909c054344834eb45f2b09c0abfcfa1be214ec4 (diff)
downloadrpm-41a32765bde2cc346bba93da364e7bdeb985fcf9.tar.gz
rpm-41a32765bde2cc346bba93da364e7bdeb985fcf9.tar.bz2
rpm-41a32765bde2cc346bba93da364e7bdeb985fcf9.zip
Merge pgpHexCvt() into pgpHexPrt(), removing it from public headers
Diffstat (limited to 'rpmio')
-rw-r--r--rpmio/rpmpgp.c9
-rw-r--r--rpmio/rpmpgp.h21
2 files changed, 8 insertions, 22 deletions
diff --git a/rpmio/rpmpgp.c b/rpmio/rpmpgp.c
index 7267345a4..f32957016 100644
--- a/rpmio/rpmpgp.c
+++ b/rpmio/rpmpgp.c
@@ -646,7 +646,14 @@ static const char * const pgpSecretELGAMAL[] = {
char * pgpHexStr(const uint8_t *p, size_t plen)
{
char *t = xmalloc(plen * 2 + 1);
- pgpHexCvt(t, p, plen);
+ static char const hex[] = "0123456789abcdef";
+ while (plen-- > 0) {
+ size_t i;
+ i = *p++;
+ *t++ = hex[ (i >> 4) & 0xf ];
+ *t++ = hex[ (i ) & 0xf ];
+ }
+ *t = '\0';
return t;
}
diff --git a/rpmio/rpmpgp.h b/rpmio/rpmpgp.h
index 05e1450cd..669dccde0 100644
--- a/rpmio/rpmpgp.h
+++ b/rpmio/rpmpgp.h
@@ -1027,27 +1027,6 @@ size_t pgpMpiLen(const uint8_t *p)
}
/** \ingroup rpmpgp
- * Convert to hex.
- * @param t target buffer (returned)
- * @param s source bytes
- * @param nbytes no. of bytes
- * @return target buffer
- */
-static inline
-char * pgpHexCvt(char *t, const uint8_t *s, size_t nbytes)
-{
- static char const hex[] = "0123456789abcdef";
- while (nbytes-- > 0) {
- size_t i;
- i = *s++;
- *t++ = hex[ (i >> 4) & 0xf ];
- *t++ = hex[ (i ) & 0xf ];
- }
- *t = '\0';
- return t;
-}
-
-/** \ingroup rpmpgp
* Return hex formatted representation of bytes.
* @param p bytes
* @param plen no. of bytes