From 6dfc04d3cc10a054fb17ee791044f643adf1cd52 Mon Sep 17 00:00:00 2001 From: Donat Zenichev Date: Fri, 25 Apr 2025 15:43:30 +0200 Subject: [PATCH] MT#59962 DRedisConnection: size_t is always >= 0 size_t will always be true against `>=` because it's a typedef for unsigned long. Makes no sense to check it, just log what it is. Fixes: Unsigned compared against 0 (NO_EFFECT) unsigned_compare: This greater-than-or-equal-to-zero comparison of an unsigned value is always true. reply->len >= 0UL. Change-Id: I75803cbe0760a1b5c4a0d056af86bc992ea0a110 --- apps/dsm/mods/mod_redis/DRedisConnection.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/apps/dsm/mods/mod_redis/DRedisConnection.cpp b/apps/dsm/mods/mod_redis/DRedisConnection.cpp index defc0f3d..adb2428e 100644 --- a/apps/dsm/mods/mod_redis/DRedisConnection.cpp +++ b/apps/dsm/mods/mod_redis/DRedisConnection.cpp @@ -113,11 +113,10 @@ int DRedisConnection::handle_redis_reply(redisReply *reply, const char* _cmd) { case REDIS_REPLY_STATUS: case REDIS_REPLY_STRING: - if (reply->len>=0) { - if (cfg.full_logging) { - DBG("REDIS %s: str: %.*s\n", _cmd, (int) reply->len, reply->str); - } - } break; + if (cfg.full_logging) { + DBG("REDIS %s: str: '%.*s'\n", _cmd, (int) reply->len, reply->str); + } + break; case REDIS_REPLY_INTEGER: if (cfg.full_logging) {