diff options
-rw-r--r-- | FICS/utils.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/FICS/utils.c b/FICS/utils.c index 66b7d56..7b17a2c 100644 --- a/FICS/utils.c +++ b/FICS/utils.c @@ -499,10 +499,12 @@ pmore_file(int p) if ((fp = fopen(parray[p].last_file, "r")) == NULL) { pprintf(p, "File not found!\n"); return -1; + } else if (fseek(fp, parray[p].last_file_byte, SEEK_SET) == -1) { + pprintf(p, "Unable to set the file position indicator.\n"); + fclose(fp); + return -1; } - fseek(fp, parray[p].last_file_byte, SEEK_SET); - while (!feof(fp) && --lcount > 0) { if (fgets(tmp, sizeof tmp, fp) != NULL && !feof(fp)) net_send_string(parray[p].socket, tmp, 1); |