From 48f8a3d60d58245978cb4bef48f0af093776015b Mon Sep 17 00:00:00 2001 From: d18c7db Date: Sun, 19 Jul 2009 07:38:51 +0000 Subject: [PATCH] fixed an intermitent pain in the ass to track down crash in the GUI client due to array overflow in sprintf, duh!!! --- winsrc/gui.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/winsrc/gui.cpp b/winsrc/gui.cpp index fcdf3863..da83c865 100644 --- a/winsrc/gui.cpp +++ b/winsrc/gui.cpp @@ -247,10 +247,12 @@ static void PaintGraph(HDC hdc) yMean /= n; } - char str[100]; + char str[200]; + sprintf(str, "@%d max=%d min=%d mean=%d n=%d/%d dt=%d [%.3f] zoom=%.3f CursorA=%d [%d] CursorB=%d [%d]", GraphStart, yMax, yMin, yMean, n, GraphTraceLen, - CursorBPos - CursorAPos, (CursorBPos - CursorAPos)/CursorScaleFactor, GraphPixelsPerPoint, CursorAPos, GraphBuffer[CursorAPos], CursorBPos, GraphBuffer[CursorBPos]); + CursorBPos - CursorAPos, (CursorBPos - CursorAPos)/CursorScaleFactor, GraphPixelsPerPoint, + CursorAPos, GraphBuffer[CursorAPos], CursorBPos, GraphBuffer[CursorBPos]); TextOut(hdc, 50, r.bottom - 20, str, strlen(str)); } @@ -321,6 +323,7 @@ nopaint: x -= offset; x = (int)(x / GraphPixelsPerPoint); x += GraphStart; + if(msg == WM_LBUTTONDOWN) { CursorAPos = x; } else { -- 2.39.5