diff options
author | ache <ache@ache.one> | 2019-09-07 03:51:45 +0200 |
---|---|---|
committer | ache <ache@ache.one> | 2019-09-07 03:51:45 +0200 |
commit | 9531b36b123889d78e9baba50e9fac3cef502714 (patch) | |
tree | 9607b717bbaae968cda7fd1a3b53fb9076945a56 | |
parent | Fix return error (diff) |
Error when contact file is empty
-rw-r--r-- | contactList.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/contactList.c b/contactList.c index b40f3d4..7dadf41 100644 --- a/contactList.c +++ b/contactList.c @@ -187,8 +187,15 @@ int fillContactList(const char* filename) { } } } + fclose(file); +#ifdef DEBUG + if( nbContacts == 0 ) { + fprintf(stderr, "contact file empty"); + return 10; + } +#endif return 0; } |