aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2026-04-03 16:09:20 +0200
committerMarkus Uhlin <markus@nifty-networks.net>2026-04-03 16:09:20 +0200
commitf6facff5ee0fc4153e7bd7fcfea93289d51b9e37 (patch)
tree6d201de9cd6e8ceb3758d1efe03a87e222d2a4d7
parent9ad6443ad05673ded4d02e1f9a94e322f2992f0f (diff)
com_news: if then else usageHEADmain
-rw-r--r--FICS/comproc.c11
1 files 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;
}