From 4b6075fab1539d3dda52ff9089fb1bb6a98fe81c Mon Sep 17 00:00:00 2001
From: Markus Uhlin <markus@nifty-networks.net>
Date: Mon, 17 Mar 2025 00:18:02 +0100
Subject: Changed psend_file()

---
 FICS/utils.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

(limited to 'FICS/utils.c')

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)) {
-- 
cgit v1.2.3