sparkline.c: AddSample skip Empty label

This commit is contained in:
Sun He 2014-12-08 11:43:32 +08:00 committed by antirez
parent 7d480abab4
commit a598e0894b

View File

@ -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 {