From 2b5fd7eaa50de964fb87d22f374543da6147ac38 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Fri, 29 Dec 2023 01:29:23 +0100 Subject: Reformatted WriteMsgFile() --- FICS/playerdb.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/FICS/playerdb.c b/FICS/playerdb.c index 83bc036..31e3fcb 100644 --- a/FICS/playerdb.c +++ b/FICS/playerdb.c @@ -2087,20 +2087,21 @@ PRIVATE int LoadMsgRange(int p, int start, int end, textlist **Head) } } -PRIVATE int WriteMsgFile (int p, textlist *Head) +PRIVATE int +WriteMsgFile(int p, textlist *Head) { - char fName[MAX_FILENAME_SIZE]; - FILE *fp; - textlist *Cur; + FILE *fp; + char fName[MAX_FILENAME_SIZE]; + textlist *Cur; - GetMsgFile (p, fName); - fp = fopen(fName, "w"); - if (fp == NULL) - return 0; - for (Cur = Head; Cur != NULL; Cur = Cur->next) - fprintf(fp, "%s", Cur->text); - fclose(fp); - return 1; + GetMsgFile(p, fName); + + if ((fp = fopen(fName, "w")) == NULL) + return 0; + for (Cur = Head; Cur != NULL; Cur = Cur->next) + fprintf(fp, "%s", Cur->text); + fclose(fp); + return 1; } PUBLIC int -- cgit v1.2.3