summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSun He <sunheehnus@gmail.com>2014-12-08 11:43:32 +0800
committerantirez <antirez@gmail.com>2014-12-09 11:28:53 +0100
commita598e0894b518643db39acf11b98adcf3e584009 (patch)
treeb0d1a571c2c134da600a5766933e85e7b75e750e
parent7d480abab498fd48b645291184d421060fc85ef7 (diff)
downloadredis-a598e0894b518643db39acf11b98adcf3e584009.tar.gz
sparkline.c: AddSample skip Empty label
-rw-r--r--src/sparkline.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sparkline.c b/src/sparkline.c
index 3355a598c..8e2764aee 100644
--- a/src/sparkline.c
+++ b/src/sparkline.c
@@ -63,7 +63,7 @@ struct sequence *createSparklineSequence(void) {
/* Add a new sample into a sequence. */
void sparklineSequenceAddSample(struct sequence *seq, double value, char *label) {
- label = label == NULL ? label : zstrdup(label);
+ label = (label == NULL || label[0] == '\0') ? NULL : zstrdup(label);
if (seq->length == 0) {
seq->min = seq->max = value;
} else {