Commit a598e089 authored by Sun He's avatar Sun He Committed by antirez
Browse files

sparkline.c: AddSample skip Empty label

parent 7d480aba
...@@ -63,7 +63,7 @@ struct sequence *createSparklineSequence(void) { ...@@ -63,7 +63,7 @@ struct sequence *createSparklineSequence(void) {
/* Add a new sample into a sequence. */ /* Add a new sample into a sequence. */
void sparklineSequenceAddSample(struct sequence *seq, double value, char *label) { 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) { if (seq->length == 0) {
seq->min = seq->max = value; seq->min = seq->max = value;
} else { } else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment