diff options
author | Mattias Andrée <maandree@kth.se> | 2021-04-03 12:55:33 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2021-04-03 12:55:33 +0200 |
commit | c2b33333b84dd0534b2cb153c7a9f31c354ddad4 (patch) | |
tree | 21295fb55d63eeffefa43472f76c69de88979c9f /get-contact-pgpkeys.c | |
parent | m + Add multicall binary (diff) | |
download | contacts-c2b33333b84dd0534b2cb153c7a9f31c354ddad4.tar.gz contacts-c2b33333b84dd0534b2cb153c7a9f31c354ddad4.tar.bz2 contacts-c2b33333b84dd0534b2cb153c7a9f31c354ddad4.tar.xz |
m + add more tools
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'get-contact-pgpkeys.c')
-rw-r--r-- | get-contact-pgpkeys.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/get-contact-pgpkeys.c b/get-contact-pgpkeys.c index ad56cc2..7935d17 100644 --- a/get-contact-pgpkeys.c +++ b/get-contact-pgpkeys.c @@ -57,8 +57,10 @@ main(int argc, char *argv[]) if (libcontacts_load_contact(*argv, &contact, user)) { weprintf("libcontacts_load_contact %s: %s\n", *argv, errno ? strerror(errno) : "contact file is malformatted"); ret = 1; - } else { - for (keys = contact.pgpkeys; (key = *keys); keys++) { + continue; + } + if ((keys = contact.pgpkeys)) { + for (; (key = *keys); keys++) { if (lookup_ctx && strcmpnul(key->context, lookup_ctx)) continue; if (lookup_id && strcmpnul(key->id, lookup_id)) @@ -76,8 +78,8 @@ main(int argc, char *argv[]) else printf("%s\n", key->context); } - libcontacts_contact_destroy(&contact); } + libcontacts_contact_destroy(&contact); } if (fflush(stdout) || ferror(stdout) || fclose(stdout)) |