From 14e409a5b4c912de7804eca7169aaf857b38a0d2 Mon Sep 17 00:00:00 2001 From: piaip Date: Mon, 11 Aug 2014 04:06:16 +0000 Subject: postd: Fix divide by zero in rebuild. git-svn-id: http://opensvn.csie.org/pttbbs/trunk@6057 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- pttbbs/daemon/postd/rebuild.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pttbbs/daemon/postd/rebuild.c b/pttbbs/daemon/postd/rebuild.c index 4c2946e8..ac0413e8 100644 --- a/pttbbs/daemon/postd/rebuild.c +++ b/pttbbs/daemon/postd/rebuild.c @@ -150,7 +150,9 @@ void rebuild_board(int bid GCC_UNUSED, boardheader_t *bp, int is_remote) } end = time4(NULL); printf(" Total %d entries (%ld bytes, %ldKb/s), Exec: %ds, Sync: %ds\n", - num, output_bytes, output_bytes / (end - start) / 1024, + num, output_bytes, + (end > start) ? output_bytes / (end - start) / 1024 : + output_bytes / 1024, syncpoint - start, end - syncpoint); close(s); } -- cgit v1.2.3