1
0
Fork 0
mirror of https://github.com/gwm17/implot.git synced 2024-11-13 14:38:51 -05:00

fix buffer overflow

This commit is contained in:
Evan Pezent 2021-03-02 21:43:45 -06:00 committed by GitHub
parent 67e0876f89
commit dd2d9ce032
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1043,7 +1043,7 @@ void ShowDemoWindow(bool* p_open) {
if (dnd[k].Plt == 1 && dnd[k].Data.size() > 0) {
ImPlot::SetPlotYAxis(dnd[k].Yax);
ImPlot::SetNextLineStyle(dnd[k].Color);
static char label[16];
static char label[32];
sprintf(label,"%s (Y%d)", dnd[k].Label, dnd[k].Yax+1);
ImPlot::PlotLine(label, &dnd[k].Data[0].x, &dnd[k].Data[0].y, dnd[k].Data.size(), 0, 2 * sizeof(float));
// allow legend item labels to be DND sources