bootchart: svg: fix checking of list end

If we have less samples than expected, systemd-bootchart will crash.

(cherry picked from commit c1682f17a0)
This commit is contained in:
Aaro Koskinen
2015-03-03 13:28:28 -05:00
committed by Zbigniew Jędrzejewski-Szmek
parent f17b6474aa
commit 668529dde3
+1 -1
View File
@@ -1170,7 +1170,7 @@ static void svg_ps_bars(void) {
ps->sample = ps->sample->next;
sample_hz = ps->sample;
for (ii=0;((ii<(int)arg_hz/2)&&(ps->sample->next));ii++)
for (ii=0;((ii<(int)arg_hz/2)&&(sample_hz->next));ii++)
sample_hz = sample_hz->next;
/* subtract bootchart cpu utilization from total */