]> the.earth.li Git - onak.git/commitdiff
Correct formatting of some places we output a keyid
authorJonathan McDowell <noodles@earth.li>
Tue, 25 Aug 2009 15:03:09 +0000 (16:03 +0100)
committerJonathan McDowell <noodles@earth.li>
Tue, 25 Aug 2009 15:03:09 +0000 (16:03 +0100)
  Format keyids in various places to be 16 digits long, zero padded
  if necessary. Closes Debian bug #540196 (which has a patch from
  Philippe Teuwen, but that uses 8 digits instead of 16).

gpgwww.c
keyindex.c
sixdegrees.c
stats.c

index 24bf49033ec7f15075a8ad71693aff985e0ae879..7d90a00332f585fc4be843af4ea73bfcb83f02ea 100644 (file)
--- a/gpgwww.c
+++ b/gpgwww.c
@@ -154,10 +154,10 @@ int main(int argc, char *argv[])
        }
 
        if (op != OP_GET) {
-               printf("<P>Looking for path from 0x%" PRIX64" to 0x%" PRIX64
-                               ".\n",
+               printf("<P>Looking for path from 0x%016" PRIX64" to 0x%016"
+                               PRIX64 ".\n",
                                from, to);
-               printf("<A HREF=\"gpgwww?from=0x%08" PRIX64 "&to=0x%08" PRIX64
+               printf("<A HREF=\"gpgwww?from=0x%016" PRIX64 "&to=0x%016" PRIX64
                                "\">Find reverse path</A>\n",
                                to,
                                from);
@@ -173,7 +173,8 @@ int main(int argc, char *argv[])
        catchsignals();
        config.dbbackend->initdb(true);
        inithash();
-       logthing(LOGTHING_NOTICE, "Looking for path from 0x%" PRIX64 " to 0x%"
+       logthing(LOGTHING_NOTICE, "Looking for path from 0x%016" PRIX64
+                       " to 0x%016"
                        PRIX64,
                        from,
                        to);
index d2094d56ee840b6d7c629e77b46aa96c4db64fcb..0cc9edd89e1bb20da6966646f6837035ea06b5c0 100644 (file)
@@ -87,9 +87,9 @@ int list_uids(uint64_t keyid, struct openpgp_signedpacket_list *uids,
                } else if (uids->packet->tag == 17) {
                        printf("                                ");
                        if (html) {
-                               printf("<img src=\"lookup?op=photo&search=0x%"
-                                       PRIX64 "&idx=%d\" alt=\"[photo id]\">"
-                                       "\n",
+                               printf("<img src=\"lookup?op=photo&search="
+                                       "0x%016" PRIX64 "&idx=%d\" alt=\""
+                                       "[photo id]\">\n",
                                        keyid,
                                        imgindx);
                                imgindx++;
index 9d2d68d3dfeb8eca4472e05ac30b00e20baf5d82..b746327e218453dad60716405358113ad2f1778e 100644 (file)
@@ -86,12 +86,13 @@ void sixdegrees(uint64_t keyid)
        config.dbbackend->cached_getkeysigs(keyid);
 
        if ((keyinfo = findinhash(keyid)) == NULL) {
-               printf("Couldn't find key 0x%" PRIX64 ".\n", keyid);
+               printf("Couldn't find key 0x%016" PRIX64 ".\n", keyid);
                return;
        }
 
        uid = config.dbbackend->keyid2uid(keyinfo->keyid);
-       printf("Six degrees for 0x%" PRIX64 " (%s):\n", keyinfo->keyid, uid);
+       printf("Six degrees for 0x%016" PRIX64 " (%s):\n", keyinfo->keyid,
+                       uid);
        free(uid);
        uid = NULL;
 
diff --git a/stats.c b/stats.c
index e009de52da5f0a6a9cb0eadbdc303f839ddc7d9c..88d7a050de183bc266367e1ed3fe3d3225845ba4 100644 (file)
--- a/stats.c
+++ b/stats.c
@@ -139,11 +139,11 @@ void dofindpath(uint64_t have, uint64_t want, bool html, int count)
        (void) config.dbbackend->cached_getkeysigs(fullwant);
 
        if ((keyinfoa = findinhash(fullhave)) == NULL) {
-               printf("Couldn't find key 0x%" PRIX64 ".\n", have);
+               printf("Couldn't find key 0x%016" PRIX64 ".\n", have);
                return;
        }
        if ((keyinfob = findinhash(fullwant)) == NULL) {
-               printf("Couldn't find key 0x%" PRIX64 ".\n", want);
+               printf("Couldn't find key 0x%016" PRIX64 ".\n", want);
                return;
        }