diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2024-12-01 08:43:47 +0100 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2024-12-01 08:43:47 +0100 |
commit | fbfdb2ced81ddc4c77ed317b642130a8138a2458 (patch) | |
tree | 76af5f3a3926572bb7f8ac63c05e947fe374680b /FICS/utils.c | |
parent | 11c6dd9df3dc897c86e31867d5749466fd7c21d5 (diff) |
Usage of sizeof
Diffstat (limited to 'FICS/utils.c')
-rw-r--r-- | FICS/utils.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/FICS/utils.c b/FICS/utils.c index 131e7bd..8d5c7cd 100644 --- a/FICS/utils.c +++ b/FICS/utils.c @@ -220,7 +220,7 @@ mail_file_to_address(char *addr, char *subj, char *fname) if ((fp2 = fopen(fname, "r")) == NULL) return -1; while (!feof(fp2)) { - fgets(tmp, MAX_LINE_SIZE - 1, fp2); + fgets(tmp, sizeof tmp, fp2); if (!feof(fp2)) { fputs(tmp, fp1); } @@ -433,7 +433,7 @@ psend_file(int p, char *dir, char *file) return -1; while (!feof(fp) && --lcount > 0) { - fgets(tmp, MAX_LINE_SIZE - 1, fp); + fgets(tmp, sizeof tmp, fp); if (!feof(fp)) net_send_string(parray[p].socket, tmp, 1); @@ -474,7 +474,7 @@ psend_logoutfile(int p, char *dir, char *file) return -1; while (!feof(fp)) { - fgets(tmp, MAX_LINE_SIZE - 1, fp); + fgets(tmp, sizeof tmp, fp); if (!feof(fp)) net_send_string(parray[p].socket, tmp, 1); @@ -504,7 +504,7 @@ pmore_file(int p) fseek(fp, parray[p].last_file_byte, SEEK_SET); while (!feof(fp) && --lcount > 0) { - fgets(tmp, MAX_LINE_SIZE, fp); + fgets(tmp, sizeof tmp, fp); if (!feof(fp)) net_send_string(parray[p].socket, tmp, 1); @@ -846,7 +846,7 @@ lines_file(char *file) return 0; while (!feof(fp)) { - if (fgets(tmp, MAX_LINE_SIZE, fp)) + if (fgets(tmp, sizeof tmp, fp)) lcount++; } |