From f79ea55743a623b309a9b9326d890519212ab93b Mon Sep 17 00:00:00 2001 From: kcwu Date: Sat, 19 Mar 2005 13:02:13 +0000 Subject: extract unit of login times git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2647 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- util/account.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'util') diff --git a/util/account.c b/util/account.c index c15411b8..b7e5e728 100644 --- a/util/account.c +++ b/util/account.c @@ -100,6 +100,7 @@ main(int argc, char **argv) int act[27]; /* 次數/累計時間/pointer */ time4_t now; struct tm *ptime; + int per_hour_unit = 10; attach_SHM(); nice(10); @@ -169,7 +170,7 @@ main(int argc, char **argv) hour = act[j]; if (hour && (max > hour) && (max - item <= hour)) { my_outs(fp, buf, '3'); - fprintf(fp, "%-3d", hour / 10); + fprintf(fp, "%-3d", hour / per_hour_unit); } else if (max <= hour) { my_outs(fp, buf, '4'); fprintf(fp, "█ "); @@ -180,7 +181,7 @@ main(int argc, char **argv) } fprintf(fp, " " "0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23\n\n" - "\t 單位: 10 人"); + "\t 單位: %d 人", per_hour_unit); fprintf(fp, " 總共上站人次:%-7d平均使用人數:%d\n", total, total / 24); fclose(fp); -- cgit v1.2.3