aboutsummaryrefslogtreecommitdiffstats
path: root/get-contact-pgpkeys.c
diff options
context:
space:
mode:
Diffstat (limited to 'get-contact-pgpkeys.c')
-rw-r--r--get-contact-pgpkeys.c8
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))