MT#57432 field precision specifier '.*' expects argument of type 'int'

We have to manually cast the `->len` of type `size_t` to the `int` type,
when it's used for the printing of logs.

Change-Id: I7e116425aecf5ee7e39d8df868edc05b33581014
mr11.4.1
Donat Zenichev 3 years ago
parent d4ca1ec99f
commit 020a164915

@ -89,7 +89,7 @@ int DRedisConnection::handle_redis_reply(redisReply *reply, const char* _cmd) {
case REDIS_REPLY_STRING:
if (reply->len>=0) {
if (cfg.full_logging) {
DBG("REDIS %s: str: %.*s\n", _cmd, reply->len, reply->str);
DBG("REDIS %s: str: %.*s\n", _cmd, (int) reply->len, reply->str);
}
} break;
@ -104,9 +104,7 @@ int DRedisConnection::handle_redis_reply(redisReply *reply, const char* _cmd) {
};
for (size_t i=0;i<reply->elements;i++) {
switch(reply->element[i]->type) {
case REDIS_REPLY_ERROR: ERROR("REDIS %s ERROR: %.*s\n",
_cmd, reply->element[i]->len,
reply->element[i]->str);
case REDIS_REPLY_ERROR: ERROR("REDIS %s ERROR: %.*s\n", _cmd, (int) reply->element[i]->len, reply->element[i]->str);
return DB_E_WRITE;
case REDIS_REPLY_INTEGER:
@ -127,10 +125,9 @@ int DRedisConnection::handle_redis_reply(redisReply *reply, const char* _cmd) {
case REDIS_REPLY_STATUS:
case REDIS_REPLY_STRING:
if (cfg.full_logging) {
if (reply->element[i]->len >= 0) {
DBG("REDIS %s: %.*s\n", _cmd,
reply->element[i]->len, reply->element[i]->str);
}
if (reply->element[i]->len >= 0) {
DBG("REDIS %s: %.*s\n", _cmd, (int) reply->element[i]->len, reply->element[i]->str);
}
}
break;
default:

Loading…
Cancel
Save