From f6facff5ee0fc4153e7bd7fcfea93289d51b9e37 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Fri, 3 Apr 2026 16:09:20 +0200 Subject: com_news: if then else usage --- FICS/comproc.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/FICS/comproc.c b/FICS/comproc.c index 0751f24..1cea82b 100644 --- a/FICS/comproc.c +++ b/FICS/comproc.c @@ -180,8 +180,7 @@ com_news(int p, param_list param) if (is_too_long(ret, sizeof filename)) { warnx("%s: fatal: too long filename", __func__); return COM_OK; - } - if ((fp = fopen(filename, "r")) == NULL) { + } else if ((fp = fopen(filename, "r")) == NULL) { (void) fprintf(stderr, "Can\'t find news index.\n"); return COM_OK; } @@ -290,14 +289,10 @@ com_news(int p, param_list param) if (is_too_long(ret, sizeof filename)) { warnx("%s: fatal: too long filename", __func__); return COM_OK; - } - - if ((fp = fopen(filename, "r")) == NULL) { + } else if ((fp = fopen(filename, "r")) == NULL) { pprintf(p, "No more info.\n"); return COM_OK; - } - - if (fclose(fp) != 0) { + } else if (fclose(fp) != 0) { warn("%s: error: fclose", __func__); return COM_OK; } -- cgit v1.2.3