From 7a06b0d9668a532a75cbdf974d056a467294b438 Mon Sep 17 00:00:00 2001 From: ache Date: Thu, 7 Feb 2019 11:00:40 +0100 Subject: Ignore empty contact --- contactList.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3