Fix bug in 'keyring list' command

Revealed by recent rhizomeprotocol test improvements.  Was always printing
empty DID and name fields.
(cherry picked from commit 7452c215e2)
This commit is contained in:
Andrew Bettison 2012-09-14 16:23:32 +09:30
parent c2b515347f
commit c1695a67b2

View File

@ -1350,7 +1350,7 @@ int keyring_find_sid(const keyring_file *k, int *cn, int *in, int *kp, const uns
void keyring_identity_extract(const keyring_identity *id, const unsigned char **sidp, const char **didp, const char **namep) void keyring_identity_extract(const keyring_identity *id, const unsigned char **sidp, const char **didp, const char **namep)
{ {
int todo = (sidp ? 1 : 0) | (didp ? 2 : 0) || (namep ? 4 : 0); int todo = (sidp ? 1 : 0) | (didp ? 2 : 0) | (namep ? 4 : 0);
int kpn; int kpn;
for (kpn = 0; todo && kpn < id->keypair_count; ++kpn) { for (kpn = 0; todo && kpn < id->keypair_count; ++kpn) {
keypair *kp = id->keypairs[kpn]; keypair *kp = id->keypairs[kpn];