Skip to content

Commit

Permalink
Match types in for loop
Browse files Browse the repository at this point in the history
  • Loading branch information
kristjanvalur committed Apr 17, 2021
1 parent e4304d6 commit d518279
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions read.c
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand All @@ -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");
Expand Down

0 comments on commit d518279

Please sign in to comment.