lib/util: Fix incorrect month in timestamps
authorMartin Schwenke <martin@meltin.net>
Thu, 11 Dec 2014 23:57:37 +0000 (10:57 +1100)
committerAmitay Isaacs <amitay@samba.org>
Fri, 12 Dec 2014 04:02:32 +0000 (05:02 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11003

Reported-by: Youzhong Yang <Youzhong.Yang@mathworks.com>
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Fri Dec 12 05:02:32 CET 2014 on sn-devel-104

lib/util/time_basic.c

index 0eeb4413717ce5eb39273b37f6aba6efca9e2baa..e4b088610b78b0484c458fee43aff694c62c78f8 100644 (file)
@@ -66,7 +66,7 @@ char *timeval_str_buf(const struct timeval *tp, bool rfc5424, bool hires,
                       (rfc5424 ?
                        "%04d-%02d-%02dT%02d:%02d:%02d" :
                        "%04d/%02d/%02d %02d:%02d:%02d"),
-                      1900 + tm->tm_year, tm->tm_mon, tm->tm_mday,
+                      1900 + tm->tm_year, tm->tm_mon + 1, tm->tm_mday,
                       tm->tm_hour, tm->tm_min, tm->tm_sec);
 
        if ((rfc5424 || hires) && (len < sizeof(dst->buf))) {