From d518279a0d68603e25c13eea13ef1747df082ee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristj=C3=A1n=20Valur=20J=C3=B3nsson?= Date: Sat, 17 Apr 2021 12:19:04 +0000 Subject: [PATCH] Match types in for loop --- read.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/read.c b/read.c index ec9d0dfd4..15f0681e7 100644 --- a/read.c +++ b/read.c @@ -352,7 +352,7 @@ static int processLineItem(redisReader *r) { } else if (cur->type == REDIS_REPLY_BIGNUM) { /* Ensure all characters are decimal digits (with possible leading * minus sign). */ - for (int i = 0; i < len; i++) { + for (size_t i = 0; i < len; i++) { /* XXX Consider: Allow leading '+'? Error on leading '0's? */ if (i == 0 && p[0] == '-') continue; if (p[i] < '0' || p[i] > '9') { @@ -367,7 +367,7 @@ static int processLineItem(redisReader *r) { obj = (void*)REDIS_REPLY_BIGNUM; } else { /* Type will be error or status. */ - for (int i = 0; i < len; i++) { + for (size_t i = 0; i < len; i++) { if (p[i] == '\r' || p[i] == '\n') { __redisReaderSetError(r,REDIS_ERR_PROTOCOL, "Bad simple string value");