aboutsummaryrefslogtreecommitdiffstats
path: root/FICS
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2025-03-17 00:18:02 +0100
committerMarkus Uhlin <markus@nifty-networks.net>2025-03-17 00:18:02 +0100
commit4b6075fab1539d3dda52ff9089fb1bb6a98fe81c (patch)
tree144d87adb6850c57ab1bf63854879089d18590e1 /FICS
parent5a926149e5c87d9b9b688e143d6ece02d752e931 (diff)
Changed psend_file()
Diffstat (limited to 'FICS')
-rw-r--r--FICS/utils.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/FICS/utils.c b/FICS/utils.c
index 7b17a2c..1435e77 100644
--- a/FICS/utils.c
+++ b/FICS/utils.c
@@ -438,9 +438,10 @@ psend_file(int p, char *dir, char *file)
if ((fp = fopen(fname, "r")) == NULL)
return -1;
- while (!feof(fp) && --lcount > 0) {
- if (fgets(tmp, sizeof tmp, fp) != NULL && !feof(fp))
- net_send_string(parray[p].socket, tmp, 1);
+ while (--lcount > 0) {
+ if (fgets(tmp, sizeof tmp, fp) == NULL)
+ break;
+ net_send_string(parray[p].socket, tmp, 1);
}
if (!feof(fp)) {