aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorache <ache@ache.one>2019-02-07 11:00:40 +0100
committerache <ache@ache.one>2019-02-07 11:00:40 +0100
commit7a06b0d9668a532a75cbdf974d056a467294b438 (patch)
treeb630fa4d5832cf022ebbb208a50fcf6ceb2204bf
parentDelete contact (diff)
Ignore empty contact
-rw-r--r--contactList.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/contactList.c b/contactList.c
index 891054c..728cade 100644
--- a/contactList.c
+++ b/contactList.c
@@ -191,7 +191,9 @@ int writeContactList(const char* filename) {
}
for( int i = 0 ; i < nbContacts ; i++) {
- fprintf(file, "%s;%s;%s\n", contactList[i].name, contactList[i].display_name, contactList[i].number);
+ if( *contactList[i].name ) {
+ fprintf(file, "%s;%s;%s\n", contactList[i].name, contactList[i].display_name, contactList[i].number);
+ }
}
fclose(file);