diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2023-12-20 00:06:44 +0100 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2023-12-20 00:06:44 +0100 |
commit | 9ca4205b38e5f8a5f631449e1db070ae2ff2a297 (patch) | |
tree | fd4c3f4fce1600bff03252b6c86a25ca806aad68 | |
parent | 95f782ae03cea47a045bb378339d0269cd6130d5 (diff) |
Reformatted rscan_news() plus 'time_t' fixes
-rw-r--r-- | FICS/command.c | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/FICS/command.c b/FICS/command.c index a6b403b..5ee2f46 100644 --- a/FICS/command.c +++ b/FICS/command.c @@ -534,26 +534,35 @@ void boot_out(int p, int p1) net_close_connection(fd); } -PUBLIC void rscan_news(FILE *fp, int p, int lc) { +PUBLIC void +rscan_news(FILE *fp, int p, int lc) +{ + char *junkp; + char count[10]; + char junk[MAX_LINE_SIZE]; + long int lval; + time_t crtime; - char junk[MAX_LINE_SIZE], count[10]; - int crtime; - char *junkp; + fgets(junk, MAX_LINE_SIZE, fp); - fgets(junk, MAX_LINE_SIZE, fp); - if (feof(fp)) - return; - sscanf(junk, "%d %s", &crtime, count); + if (feof(fp)) + return; - if (crtime - lc < 0) - return; - else { - rscan_news(fp, p, lc); - junkp = junk; - junkp = nextword(junkp); - junkp = nextword(junkp); - pprintf(p, "%3s (%s) %s", count, fix_time(strltime(&crtime)), junkp); - } + sscanf(junk, "%ld %s", &lval, count); + crtime = lval; + + if ((crtime - lc) < 0) + return; + else { + rscan_news(fp, p, lc); + + junkp = junk; + junkp = nextword(junkp); + junkp = nextword(junkp); + + pprintf(p, "%3s (%s) %s", count, fix_time(strltime(&crtime)), + junkp); + } } PRIVATE void |