perf stat: Avoid metric-only segv
[linux-2.6-microblaze.git] / tools / perf / util / stat-display.c
index 4dfe7d9..ae37395 100644 (file)
@@ -571,7 +571,7 @@ static void print_metric_only(struct perf_stat_config *config,
        if (color)
                mlen += strlen(color) + sizeof(PERF_COLOR_RESET) - 1;
 
-       color_snprintf(str, sizeof(str), color ?: "", fmt, val);
+       color_snprintf(str, sizeof(str), color ?: "", fmt ?: "", val);
        fprintf(out, "%*s ", mlen, str);
        os->first = false;
 }