aboutsummaryrefslogtreecommitdiffstats
path: root/get-contact-emails.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-04-03 10:31:02 +0200
committerMattias Andrée <maandree@kth.se>2021-04-03 10:31:02 +0200
commitc3cac7a521857747771f661d607004f58470e0cc (patch)
tree91a9058a1000a121a7c89dd7869c866b4d63ca80 /get-contact-emails.c
parentFirst commmit (diff)
downloadcontacts-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 '')
-rw-r--r--get-contact-emails.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/get-contact-emails.c b/get-contact-emails.c
index 433cf22..891c873 100644
--- a/get-contact-emails.c
+++ b/get-contact-emails.c
@@ -59,9 +59,9 @@ main(int argc, char *argv[])
ret = 1;
} else {
for (emails = contact.emails; (email = *emails); emails++) {
- if (lookup_ctx && (!email->context || strcmp(email->context, lookup_ctx)))
+ if (lookup_ctx && strcmpnul(email->context, lookup_ctx))
continue;
- if (lookup_addr && (!email->address || strcmp(email->address, lookup_addr)))
+ if (lookup_addr && strcmpnul(email->address, lookup_addr))
continue;
if (lookup_ctx && lookup_addr && !display_ctx && !display_addr) {
printf("%s\n", *argv);