From 318bcd2df2a468bb49ff228d885351d70390a28a Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sat, 15 Sep 2012 19:31:23 +0200 Subject: [PATCH] Fix time overflow bug Time is stored in tenths of seconds, which makes it overflow. An attempt to correct this in untenths() was ineffective, because of a signed/unsigned mistake. (0xffffffff is not a large number, but equals -1!) --- lasker-2.2.3/src/utils.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lasker-2.2.3/src/utils.c b/lasker-2.2.3/src/utils.c index d4c1da7..9b3ee5c 100644 --- a/lasker-2.2.3/src/utils.c +++ b/lasker-2.2.3/src/utils.c @@ -485,7 +485,7 @@ unsigned tenth_secs(void) */ int untenths(unsigned tenths) { - return (tenths / 10 + 331939277 + 0xffffffff / 10 + 1); + return (tenths / 10 + 331939277 + 4*((1<<30) / 5) + 1); } char *tenth_str(unsigned t, int spaces) -- 1.7.0.4