From cbea69c909bfe4aed541d1b4ffc2f859642f4000 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 17 Jan 2019 13:58:14 +0100 Subject: [PATCH] s3:lib: Fix the debug message for adding cache entries. 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 Reviewed-by: Volker Lendecke --- source3/lib/gencache.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source3/lib/gencache.c b/source3/lib/gencache.c index ab12fc1c531..9f4e1cfcaa3 100644 --- a/source3/lib/gencache.c +++ b/source3/lib/gencache.c @@ -294,11 +294,11 @@ bool gencache_set_data_blob(const char *keystr, DATA_BLOB blob, dbufs[0] = (TDB_DATA) { .dptr = (uint8_t *)hdr, .dsize = hdr_len }; dbufs[1] = (TDB_DATA) { .dptr = blob.data, .dsize = blob.length }; - 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_storev(cache_notrans->tdb, string_term_tdb_data(keystr), dbufs, 2, 0); -- 2.20.1