diff options
author | Mattias Andrée <maandree@kth.se> | 2021-04-03 10:31:02 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2021-04-03 10:31:02 +0200 |
commit | c3cac7a521857747771f661d607004f58470e0cc (patch) | |
tree | 91a9058a1000a121a7c89dd7869c866b4d63ca80 /get-contact-pgpkeys.c | |
parent | First commmit (diff) | |
download | contacts-c3cac7a521857747771f661d607004f58470e0cc.tar.gz contacts-c3cac7a521857747771f661d607004f58470e0cc.tar.bz2 contacts-c3cac7a521857747771f661d607004f58470e0cc.tar.xz |
Use strcmpnul
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'get-contact-pgpkeys.c')
-rw-r--r-- | get-contact-pgpkeys.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/get-contact-pgpkeys.c b/get-contact-pgpkeys.c index 9a1250a..ad56cc2 100644 --- a/get-contact-pgpkeys.c +++ b/get-contact-pgpkeys.c @@ -59,9 +59,9 @@ main(int argc, char *argv[]) ret = 1; } else { for (keys = contact.pgpkeys; (key = *keys); keys++) { - if (lookup_ctx && (!key->context || strcmp(key->context, lookup_ctx))) + if (lookup_ctx && strcmpnul(key->context, lookup_ctx)) continue; - if (lookup_id && (!key->id || strcmp(key->id, lookup_id))) + if (lookup_id && strcmpnul(key->id, lookup_id)) continue; if (lookup_ctx && lookup_id && !display_ctx && !display_id) { printf("%s\n", *argv); |