[PATCH] dbwrap: Improve some debugs

Volker Lendecke vl at samba.org
Mon Aug 29 13:57:30 UTC 2016


Hi!

Review appreciated!

Thanks, Volker
-------------- next part --------------
>From 289703cb130a71f796d578b07d7ff913f54480c8 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Mon, 25 Jul 2016 12:59:46 +0200
Subject: [PATCH] dbwrap_watch: Add dsize to DEBUG, avoid casts

Signed-off-by: Volker Lendecke <vl at samba.org>
---
 source3/lib/dbwrap/dbwrap_watch.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/source3/lib/dbwrap/dbwrap_watch.c b/source3/lib/dbwrap/dbwrap_watch.c
index acc0f1a..00c332f 100644
--- a/source3/lib/dbwrap/dbwrap_watch.c
+++ b/source3/lib/dbwrap/dbwrap_watch.c
@@ -66,13 +66,13 @@ static bool dbwrap_record_watchers_key_parse(
 	size_t db_id_len;
 
 	if (wkey.dsize < sizeof(uint32_t)) {
-		DEBUG(1, ("Invalid watchers key\n"));
+		DBG_WARNING("Invalid watchers key, dsize=%zu\n", wkey.dsize);
 		return false;
 	}
 	db_id_len = IVAL(wkey.dptr, 0);
 	if (db_id_len > (wkey.dsize - sizeof(uint32_t))) {
-		DEBUG(1, ("Invalid watchers key, wkey.dsize=%d, "
-			  "db_id_len=%d\n", (int)wkey.dsize, (int)db_id_len));
+		DBG_WARNING("Invalid watchers key, wkey.dsize=%zu, "
+			    "db_id_len=%zu\n", wkey.dsize, db_id_len);
 		return false;
 	}
 	if (p_db_id != NULL) {
-- 
2.1.4



More information about the samba-technical mailing list