diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2023-12-15 20:42:54 +0100 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2023-12-15 20:42:54 +0100 |
commit | 2a1e34dd78be0257029ac80712de8d417207c0d0 (patch) | |
tree | 52ec3315aa76e434d5734b54cf5f615249f462b9 | |
parent | 9b18064b89d21eefcc47402589db35e344d28c9d (diff) |
Reformatted functions
-rw-r--r-- | FICS/lists.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/FICS/lists.c b/FICS/lists.c index 4a974a5..db6a7a1 100644 --- a/FICS/lists.c +++ b/FICS/lists.c @@ -142,26 +142,28 @@ PUBLIC int list_sub(int p, enum ListWhich l, char *s) } /* pretty cheesy: print each member of a list, 1 per line */ -PUBLIC void list_print(FILE * fp, int p, enum ListWhich l) +PUBLIC void +list_print(FILE *fp, int p, enum ListWhich l) { - int i; - List *gl = list_find(p, l); + List *gl; - if (gl) { - for (i = 0; i < gl->numMembers; i++) - fprintf(fp, "%s\n", gl->member[i]); - } + if ((gl = list_find(p, l)) != NULL) { + for (int i = 0; i < gl->numMembers; i++) + fprintf(fp, "%s\n", gl->member[i]); + } } -/* return size of a list */ -PUBLIC int list_size(int p, enum ListWhich l) +/* + * Return size of a list. + */ +PUBLIC int +list_size(int p, enum ListWhich l) { - List *gl = list_find(p, l); + List *gl; - if (gl) - return (gl->numMembers); - else - return 0; + if ((gl = list_find(p, l)) != NULL) + return (gl->numMembers); + return 0; } /* |