summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2016-11-16 14:13:13 +0100
committerantirez <antirez@gmail.com>2016-11-16 14:13:13 +0100
commit92958df3b1306fb787d3eeb21889ba91d6fb7168 (patch)
treeb94bfcc3bd5187fd76de41ba3ef967dd42396239
parent0ee28ae40ccf834d949f65287cf466047b41018f (diff)
downloadredis-92958df3b1306fb787d3eeb21889ba91d6fb7168.tar.gz
Cluster: handle zero bytes at the end of nodes.conf.
-rw-r--r--src/cluster.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cluster.c b/src/cluster.c
index 9d53c9812..2dd3344c6 100644
--- a/src/cluster.c
+++ b/src/cluster.c
@@ -129,7 +129,7 @@ int clusterLoadConfig(char *filename) {
/* Skip blank lines, they can be created either by users manually
* editing nodes.conf or by the config writing process if stopped
* before the truncate() call. */
- if (line[0] == '\n') continue;
+ if (line[0] == '\n' || line[0] == '\0') continue;
/* Split the line into arguments for processing. */
argv = sdssplitargs(line,&argc);