mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-01-06 08:08:53 +08:00
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:
parent
2c0d55d8de
commit
48f8a3d60d
1 changed files with 5 additions and 2 deletions
|
@ -247,10 +247,12 @@ static void PaintGraph(HDC hdc)
|
||||||
yMean /= n;
|
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]",
|
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,
|
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));
|
TextOut(hdc, 50, r.bottom - 20, str, strlen(str));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -321,6 +323,7 @@ nopaint:
|
||||||
x -= offset;
|
x -= offset;
|
||||||
x = (int)(x / GraphPixelsPerPoint);
|
x = (int)(x / GraphPixelsPerPoint);
|
||||||
x += GraphStart;
|
x += GraphStart;
|
||||||
|
|
||||||
if(msg == WM_LBUTTONDOWN) {
|
if(msg == WM_LBUTTONDOWN) {
|
||||||
CursorAPos = x;
|
CursorAPos = x;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue