Merge pgpHexCvt() into pgpHexPrt(), removing it from public headers
authorPanu Matilainen <pmatilai@redhat.com>
Mon, 7 Apr 2008 10:29:48 +0000 (13:29 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Mon, 7 Apr 2008 10:29:48 +0000 (13:29 +0300)
rpmio/rpmpgp.c
rpmio/rpmpgp.h

index 7267345..f329570 100644 (file)
@@ -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;
 }
 
index 05e1450..669dccd 100644 (file)
@@ -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