From: d18c7db Date: Sun, 19 Jul 2009 07:38:51 +0000 (+0000) Subject: fixed an intermitent pain in the ass to track down crash in the GUI client due to... X-Git-Tag: v1.0.0~553 X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/commitdiff_plain/48f8a3d60d58245978cb4bef48f0af093776015b?ds=sidebyside;hp=2c0d55d8decee6aad49c134aded8b9c15e3e3178 fixed an intermitent pain in the ass to track down crash in the GUI client due to array overflow in sprintf, duh!!! --- 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 {