From 07a9e44b86eff660e55bc1044a667eda7b981973 Mon Sep 17 00:00:00 2001 From: Sun He Date: Mon, 8 Dec 2014 11:43:32 +0800 Subject: [PATCH] sparkline.c: AddSample skip Empty label --- src/sparkline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sparkline.c b/src/sparkline.c index 3355a598..8e2764ae 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 {