gpg: Do not print a the short keyid if the high word is zero.
authorWerner Koch <wk@gnupg.org>
Wed, 13 Jul 2016 15:19:56 +0000 (17:19 +0200)
committerWerner Koch <wk@gnupg.org>
Wed, 13 Jul 2016 15:19:56 +0000 (17:19 +0200)
* g10/keyid.c (format_keyid): Always returh long keyid ifor KF_LONG.

Signed-off-by: Werner Koch <wk@gnupg.org>
g10/keyid.c

index e67f67f..84990a3 100644 (file)
@@ -347,11 +347,7 @@ format_keyid (u32 *keyid, int format, char *buffer, int len)
       break;
 
     case KF_LONG:
-      if (keyid[0])
-       snprintf (buffer, len, "%08lX%08lX",
-                  (ulong)keyid[0], (ulong)keyid[1]);
-      else
-       snprintf (buffer, len, "%08lX", (ulong)keyid[1]);
+      snprintf (buffer, len, "%08lX%08lX", (ulong)keyid[0], (ulong)keyid[1]);
       break;
 
     case KF_0xSHORT:
@@ -359,11 +355,7 @@ format_keyid (u32 *keyid, int format, char *buffer, int len)
       break;
 
     case KF_0xLONG:
-      if(keyid[0])
-       snprintf (buffer, len, "0x%08lX%08lX",
-                  (ulong)keyid[0],(ulong)keyid[1]);
-      else
-       snprintf (buffer, len, "0x%08lX", (ulong)keyid[1]);
+      snprintf (buffer, len, "0x%08lX%08lX", (ulong)keyid[0],(ulong)keyid[1]);
       break;
 
     default: