From 0419ca8378046fbf42cb837dcbb54682ef7495c6 Mon Sep 17 00:00:00 2001 From: Jonathan McDowell Date: Sun, 1 Apr 2012 14:09:12 -0700 Subject: [PATCH] Fix display of SHA-1 fingerprints SHA-1 fingerprints have a double space in the middle and we were putting the extra space in the wrong place. --- keyindex.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/keyindex.c b/keyindex.c index eee2e8a..4eedf1f 100644 --- a/keyindex.c +++ b/keyindex.c @@ -189,10 +189,11 @@ void display_fingerprint(struct openpgp_publickey *key) (i % 2 == 0)) { printf(" "); } - printf("%02X", fp[i]); - if ((i * 2) == length) { + if (length == 20 && (i * 2) == length) { + /* Extra space in the middle of a SHA1 fingerprint */ printf(" "); } + printf("%02X", fp[i]); } printf("\n"); -- 2.39.5