diff options
author | ache <ache@ache.one> | 2019-02-07 11:00:40 +0100 |
---|---|---|
committer | ache <ache@ache.one> | 2019-02-07 11:00:40 +0100 |
commit | 7a06b0d9668a532a75cbdf974d056a467294b438 (patch) | |
tree | b630fa4d5832cf022ebbb208a50fcf6ceb2204bf | |
parent | Delete contact (diff) |
Ignore empty contact
-rw-r--r-- | contactList.c | 4 |
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); |