Renaming data sources was added in
e8bb97ce30051b999a4a69c9b27884daeb8d71e6
It was possible to use a new name longer than
the name array in hud_graph of 128. This
patch truncates the name to fit the array.
CC: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
strip_hyphens(s);
if (!LIST_IS_EMPTY(&pane->graph_list)) {
- strcpy(LIST_ENTRY(struct hud_graph,
- pane->graph_list.prev, head)->name, s);
+ struct hud_graph *graph;
+ graph = LIST_ENTRY(struct hud_graph, pane->graph_list.prev, head);
+ strncpy(graph->name, s, sizeof(graph->name)-1);
+ graph->name[sizeof(graph->name)-1] = 0;
}
}