From 9ee55b6a6149080092ef8f8d3fbe1fd04a3b1461 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Tue, 19 Dec 2023 22:43:38 +0100 Subject: Reformatted rscan_news2() and changed the type of var 'crtime' to 'time_t' --- FICS/comproc.c | 42 +++++++++++++++++++++++++----------------- 1 file 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 -- cgit v1.2.3