mirror of
https://github.com/reactos/reactos.git
synced 2025-05-25 12:14:32 +00:00
[CHARMAP]
Don't overrun FillGrid() when accessing the last elements. Rewrite the code using 'for' loops, in the same style as what is done elsewhere in the code. CID 1363552 CORE-11597 #resolve svn path=/trunk/; revision=71924
This commit is contained in:
parent
380484c985
commit
3aa8e4c2ac
1 changed files with 3 additions and 10 deletions
|
@ -107,8 +107,9 @@ FillGrid(PMAP infoPtr,
|
||||||
i = XCELLS * infoPtr->iYStart;
|
i = XCELLS * infoPtr->iYStart;
|
||||||
|
|
||||||
added = 0;
|
added = 0;
|
||||||
x = y = 0;
|
|
||||||
while ((y <= YCELLS) && (x <= XCELLS))
|
for (y = 0; y < YCELLS; y++)
|
||||||
|
for (x = 0; x < XCELLS; x++)
|
||||||
{
|
{
|
||||||
ch = (WCHAR)infoPtr->ValidGlyphs[i];
|
ch = (WCHAR)infoPtr->ValidGlyphs[i];
|
||||||
|
|
||||||
|
@ -131,14 +132,6 @@ FillGrid(PMAP infoPtr,
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
ch = (WCHAR)i;
|
ch = (WCHAR)i;
|
||||||
|
|
||||||
// move to the next cell
|
|
||||||
x++;
|
|
||||||
if (x > XCELLS - 1)
|
|
||||||
{
|
|
||||||
x = 0;
|
|
||||||
y++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
SelectObject(ps->hdc,
|
SelectObject(ps->hdc,
|
||||||
hOldFont);
|
hOldFont);
|
||||||
|
|
Loading…
Reference in a new issue