mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-01-30 02:28:31 +00:00
Fix "Using log-scaled graph with show_graph_scale causes segfault" (sf.net #3538674)
bug reported by Nikslay
This commit is contained in:
parent
2011665234
commit
410c89ab1c
@ -3155,9 +3155,7 @@ int draw_each_line_inner(char *s, int special_index, int last_special_applied)
|
|||||||
char *tmp_str;
|
char *tmp_str;
|
||||||
cur_x += font_ascent() / 2;
|
cur_x += font_ascent() / 2;
|
||||||
cur_y += font_h / 2;
|
cur_y += font_h / 2;
|
||||||
tmp_str = (char *)
|
tmp_str = (char *) calloc(20, sizeof(char));
|
||||||
calloc(log10(floor(specials[special_index].graph_scale)) + 4,
|
|
||||||
sizeof(char));
|
|
||||||
sprintf(tmp_str, "%.1f", specials[special_index].graph_scale);
|
sprintf(tmp_str, "%.1f", specials[special_index].graph_scale);
|
||||||
draw_string(tmp_str);
|
draw_string(tmp_str);
|
||||||
free(tmp_str);
|
free(tmp_str);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user