Further redundancy / copy-paste coding elimination
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 2 Apr 2008 12:42:21 +0000 (15:42 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Wed, 2 Apr 2008 12:42:21 +0000 (15:42 +0300)
lib/rpmchecksig.c

index 0e2a693..61c07a4 100644 (file)
@@ -759,15 +759,9 @@ int rpmVerifySignatures(QVA_t qva, rpmts ts, FD_t fd,
                                offset = 9;
                            }
                            if (tempKey) {
-                             if (res3 == RPMRC_NOKEY) {
-                               m = stpcpy(m, " PGP#");
-                               m = stpncpy(m, tempKey + offset, 8);
-                               *m = '\0';
-                             } else {
-                               u = stpcpy(u, " PGP#");
-                               u = stpncpy(u, tempKey + offset, 8);
-                               *u = '\0';
-                             }
+                               char * kt = (res3 == RPMRC_NOKEY ? m : u);
+                               kt = stpcpy(kt, " PGP#");
+                               kt = stpncpy(kt, tempKey + offset, 8);
                            }
                        }   break;
                        default: