cpuidle handle newlines in names (#5425)
* Fix issue #5418 * Use trim to take out new line
Chris Akritidis committed
Feb 20, 2019 at 18:56 UTC
8a0ce020550567e022b322a4199b1f1e1d6af90c
1 file changed
+1
-1
collectors/proc.plugin/proc_stat.c
+1
-1
@@ -427,7 +427,7 @@ static int read_cpuidle_states(char *cpuidle_name_filename , char *cpuidle_time_
427
}
428
429
name_buf[r - 1] = '\0'; // erase extra character
430
- cc->cpuidle_state[state].name = strdupz(name_buf);
430
+ cc->cpuidle_state[state].name = strdupz(trim(name_buf));
431
close(fd);
432
433
snprintfz(filename, FILENAME_MAX, cpuidle_time_filename, core, state);