diff options
-rw-r--r-- | FICS/lists.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/FICS/lists.c b/FICS/lists.c index 5f93baf..c76e645 100644 --- a/FICS/lists.c +++ b/FICS/lists.c @@ -89,11 +89,9 @@ list_find(int p, enum ListWhich l) rfree(tempList); return NULL; } - while (!feof(fp)) { - if (fgets(listmember, 100, fp) != NULL) { - listmember[strlen(listmember) - 1] = '\0'; - tempList->member[count++] = xstrdup(listmember); - } + while (fgets(listmember, ARRAY_SIZE(listmember), fp) != NULL) { + listmember[strcspn(listmember, "\n")] = '\0'; + tempList->member[count++] = xstrdup(listmember); } fclose(fp); |