From 0e7248ee337b29218b2e7a0be539db6e5da3c8af Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 12 Apr 2021 14:19:06 +0200 Subject: Fix set-contact-blocks and unblock-contact MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- TODO | 3 --- set-contact-blocks.c | 2 +- unblock-contact.c | 1 + 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/TODO b/TODO index 79237d6..11a4135 100644 --- a/TODO +++ b/TODO @@ -1,6 +1,3 @@ -Test set-contact-blocks -Test get-contact-blocks -Test unblock-contact Add ability to filter on unset values in entries Add ability to remove values in entries Add man pages diff --git a/set-contact-blocks.c b/set-contact-blocks.c index 9e1ada5..ddab383 100644 --- a/set-contact-blocks.c +++ b/set-contact-blocks.c @@ -197,7 +197,7 @@ main(int argc, char *argv[]) for (; contact.blocks[i]; i++); contact.blocks = erealloc(contact.blocks, (i + 2) * sizeof(*contact.blocks)); contact.blocks[i + 1] = NULL; - contact.blocks[i] = ecalloc(1, sizeof(**contact.emails)); + contact.blocks[i] = ecalloc(1, sizeof(**contact.blocks)); contact.blocks[i]->service = estrdup(srv ? srv : ".global"); contact.blocks[i]->explicit = explicit; contact.blocks[i]->shadow_block = shadow_block; diff --git a/unblock-contact.c b/unblock-contact.c index ad2b5a0..e16a97c 100644 --- a/unblock-contact.c +++ b/unblock-contact.c @@ -114,6 +114,7 @@ main(int argc, char *argv[]) libcontacts_block_destroy(*w); free(*w--); } + *w = NULL; if (libcontacts_save_contact(&contact, user)) eprintf("libcontacts_save_contact %s:", *argv); } -- cgit v1.2.3-70-g09d2