Post
Topic
Board Mining software (miners)
Re: New demonstration CPU miner available
by
ancow
on 11/04/2011, 21:21:46 UTC
I just noticed this - the date reads a month in the past in the CPU miner.  Is this a problem on my end?  My computer's date/time are set correct.
Actually it seems like an off-by-one error in the code. If memory serves me right (and it has been a few years since my last brush with C), tm_mon is zero-based, so the following diff should be applied to util.c:
Code:
--- cpuminer-git/util.c 2011-04-11 21:12:43.469374001 +0200
+++ cpuminer-compile/util.c     2011-04-11 21:22:49.149374000 +0200
@@ -80,7 +80,7 @@
                f = alloca(len);
                sprintf(f, "[%d-%02d-%02d %02d:%02d:%02d] %s\n",
                        tm.tm_year + 1900,
-                       tm.tm_mon,
+                       tm.tm_mon + 1,
                        tm.tm_mday,
                        tm.tm_hour,
                        tm.tm_min,