s3:lib: Fix the debug message for adding cache entries.
authorAndreas Schneider <asn@samba.org>
Thu, 17 Jan 2019 12:58:14 +0000 (13:58 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Sat, 19 Jan 2019 11:24:18 +0000 (12:24 +0100)
To get correct values, we need to cast 'timeout' to 'long int' first in
order to do calculation in that integer space! Calculations are don in
the space of the lvalue!

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/lib/gencache.c

index d6ef28c140f90ea618feee1e66d5db0cc1584992..9ad85bbf55f155e5129a38e5c34352949d2882b9 100644 (file)
@@ -219,11 +219,11 @@ bool gencache_set_data_blob(const char *keystr, DATA_BLOB blob,
        dbufs[2] = (TDB_DATA) { .dptr = (uint8_t *)&crc,
                                .dsize = sizeof(crc) };
 
-       DEBUG(10, ("Adding cache entry with key=[%s] and timeout="
-                  "[%s] (%d seconds %s)\n", keystr,
+       DBG_DEBUG("Adding cache entry with key=[%s] and timeout="
+                  "[%s] (%ld seconds %s)\n", keystr,
                   timestring(talloc_tos(), timeout),
-                  (int)(timeout - time(NULL)), 
-                  timeout > time(NULL) ? "ahead" : "in the past"));
+                  ((long int)timeout) - time(NULL),
+                  timeout > time(NULL) ? "ahead" : "in the past");
 
        ret = tdb_chainlock(cache->tdb, key);
        if (ret == -1) {