summaryrefslogtreecommitdiff
path: root/src/sparkline.c
diff options
context:
space:
mode:
authorSun He <sunheehnus@gmail.com>2014-12-08 11:43:32 +0800
committerSun He <sunheehnus@gmail.com>2014-12-08 11:43:32 +0800
commit07a9e44b86eff660e55bc1044a667eda7b981973 (patch)
treeac5d9e071821ef67cb8ede591d02ec01cf9538fa /src/sparkline.c
parentc87a37661e14b288d2510b3e4de088a3fed3e5c0 (diff)
downloadredis-07a9e44b86eff660e55bc1044a667eda7b981973.tar.gz
sparkline.c: AddSample skip Empty label
Diffstat (limited to 'src/sparkline.c')
-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 {