diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2023-12-19 22:43:38 +0100 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2023-12-19 22:43:38 +0100 |
commit | 9ee55b6a6149080092ef8f8d3fbe1fd04a3b1461 (patch) | |
tree | 425c5ef128a6ddd5ce28b6864208b6d9fd8e1a7e | |
parent | ea64f288f1a1f7675047737cd4849fd4a3e1a5f3 (diff) |
Reformatted rscan_news2() and changed the type of var 'crtime' to 'time_t'
-rw-r--r-- | FICS/comproc.c | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/FICS/comproc.c b/FICS/comproc.c index ec6c4a2..66a46b8 100644 --- a/FICS/comproc.c +++ b/FICS/comproc.c @@ -75,24 +75,32 @@ PUBLIC int com_more(int p, param_list param) PUBLIC int num_news = -1; -PUBLIC void rscan_news2(FILE *fp, int p, int num) +PUBLIC void +rscan_news2(FILE *fp, int p, int num) { - char junk[MAX_LINE_SIZE], count[10]; - int crtime; - char *junkp; - - if (num == 0) - return; - - fgets(junk, MAX_LINE_SIZE, fp); - if (feof(fp)) - return; - sscanf(junk, "%d %s", &crtime, count); - rscan_news2(fp, p, num - 1); - junkp = junk; - junkp = nextword(junkp); - junkp = nextword(junkp); - pprintf(p, "%3s (%s) %s", count, fix_time(strltime(&crtime)), junkp); + char *junkp; + char count[10]; + char junk[MAX_LINE_SIZE]; + long int lval; + time_t crtime; + + if (num == 0) + return; + + fgets(junk, MAX_LINE_SIZE, fp); + + if (feof(fp)) + return; + + sscanf(junk, "%ld %s", &lval, count); + rscan_news2(fp, p, num - 1); + + junkp = junk; + junkp = nextword(junkp); + junkp = nextword(junkp); + + crtime = lval; + pprintf(p, "%3s (%s) %s", count, fix_time(strltime(&crtime)), junkp); } PUBLIC int |