summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Grunder <michael.grunder@gmail.com>2020-10-12 15:47:14 -0700
committerGitHub <noreply@github.com>2020-10-12 15:47:14 -0700
commitacc917548dcfd91e5d56387ed58b5f408cdb810a (patch)
treeb36ce21724d524ee3d8b7fb66840d7c63f13acd0
parentb47fae4e7012a9e868db4e0cdfd2fb078a715706 (diff)
parentb086f763e79fea24d227450da07d877f91436130 (diff)
Merge pull request #885 from gkorland/patch-1
clean a warning, remvoe empty else block
-rw-r--r--hiredis.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/hiredis.c b/hiredis.c
index a7fbf48..1170d75 100644
--- a/hiredis.c
+++ b/hiredis.c
@@ -938,13 +938,11 @@ int redisBufferRead(redisContext *c) {
return REDIS_ERR;
nread = c->funcs->read(c, buf, sizeof(buf));
- if (nread > 0) {
- if (redisReaderFeed(c->reader, buf, nread) != REDIS_OK) {
- __redisSetError(c, c->reader->err, c->reader->errstr);
- return REDIS_ERR;
- } else {
- }
- } else if (nread < 0) {
+ if (nread < 0) {
+ return REDIS_ERR;
+ }
+ if (nread > 0 && redisReaderFeed(c->reader, buf, nread) != REDIS_OK) {
+ __redisSetError(c, c->reader->err, c->reader->errstr);
return REDIS_ERR;
}
return REDIS_OK;