Skip to content

Commit

Permalink
Fix a false positive warning of gcc 12+ -Werror=maybe-uninitialized
Browse files Browse the repository at this point in the history
  • Loading branch information
eitlane authored and michael-grunder committed Jul 14, 2023
1 parent bff171c commit dedc620
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test.c
Original file line number Diff line number Diff line change
Expand Up @@ -1340,7 +1340,7 @@ static void test_blocking_io_errors(struct config config) {
}

static void test_invalid_timeout_errors(struct config config) {
redisContext *c;
redisContext *c = NULL;

test("Set error when an invalid timeout usec value is used during connect: ");

Expand All @@ -1355,7 +1355,7 @@ static void test_invalid_timeout_errors(struct config config) {
assert(NULL);
}

test_cond(c->err == REDIS_ERR_IO && strcmp(c->errstr, "Invalid timeout specified") == 0);
test_cond(c != NULL && c->err == REDIS_ERR_IO && strcmp(c->errstr, "Invalid timeout specified") == 0);
redisFree(c);

test("Set error when an invalid timeout sec value is used during connect: ");
Expand All @@ -1371,7 +1371,7 @@ static void test_invalid_timeout_errors(struct config config) {
assert(NULL);
}

test_cond(c->err == REDIS_ERR_IO && strcmp(c->errstr, "Invalid timeout specified") == 0);
test_cond(c != NULL && c->err == REDIS_ERR_IO && strcmp(c->errstr, "Invalid timeout specified") == 0);
redisFree(c);
}

Expand Down

0 comments on commit dedc620

Please sign in to comment.