aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-04-12 14:19:06 +0200
committerMattias Andrée <maandree@kth.se>2021-04-12 14:19:06 +0200
commit0e7248ee337b29218b2e7a0be539db6e5da3c8af (patch)
tree8ac0e935a8d739ff8f6d7c00476aa13c31ed6fd1
parentDeduplicate code and make some small improvements (diff)
downloadcontacts-0e7248ee337b29218b2e7a0be539db6e5da3c8af.tar.gz
contacts-0e7248ee337b29218b2e7a0be539db6e5da3c8af.tar.bz2
contacts-0e7248ee337b29218b2e7a0be539db6e5da3c8af.tar.xz
Fix set-contact-blocks and unblock-contact
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--TODO3
-rw-r--r--set-contact-blocks.c2
-rw-r--r--unblock-contact.c1
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);
}