fixed an intermitent pain in the ass to track down crash in the GUI client due to array overflow in sprintf, duh!!!

This commit is contained in:
d18c7db 2009-07-19 07:38:51 +00:00
parent 2c0d55d8de
commit 48f8a3d60d

View file

@ -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 {