2007-08-03 13:30 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/contrib/libct/ctwin.c
    * added protection against overwriting right and bottom WBOX border
      directly inside GTCTW so now other screen functions does not have
      to check maximum window coordinates. Please remeber that CTWIN from
      CT3 has a bug which allows to damage top and left border which I
      partialy replicated because peope used it to set window title.
This commit is contained in:
Przemyslaw Czerpak
2007-08-03 11:30:22 +00:00
parent 26aae29987
commit 6ed7c1f6b2
2 changed files with 17 additions and 3 deletions

View File

@@ -8,6 +8,14 @@
2002-12-01 13:30 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2007-08-03 13:30 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/contrib/libct/ctwin.c
* added protection against overwriting right and bottom WBOX border
directly inside GTCTW so now other screen functions does not have
to check maximum window coordinates. Please remeber that CTWIN from
CT3 has a bug which allows to damage top and left border which I
partialy replicated because peope used it to set window title.
2007-08-03 04:05 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/contrib/libct/screen2.c
+ added SCREENSTR(), STRSCREEN()

View File

@@ -1293,12 +1293,14 @@ static BOOL hb_ctw_gt_PutChar( int iRow, int iCol,
if( iWindow > 0 )
{
int iWndRow, iWndCol;
int iWndRow, iWndCol, iWndHeight, iWndWidth;
if( s_iCurrWindow == 0 )
{
iWndRow = iRow - s_windows[ iWindow ]->iFirstRow;
iWndCol = iCol - s_windows[ iWindow ]->iFirstCol;
iWndHeight = s_windows[ iWindow ]->iWidth;
iWndWidth = s_windows[ iWindow ]->iWidth;
}
else
{
@@ -1306,10 +1308,14 @@ static BOOL hb_ctw_gt_PutChar( int iRow, int iCol,
iWndCol = iCol + s_windows[ iWindow ]->iLeftMargin;
iRow = iWndRow + s_windows[ iWindow ]->iFirstRow;
iCol = iWndCol + s_windows[ iWindow ]->iFirstCol;
iWndHeight = s_windows[ iWindow ]->iHeight -
s_windows[ iWindow ]->iBottomMargin;
iWndWidth = s_windows[ iWindow ]->iWidth -
s_windows[ iWindow ]->iRightMargin;
}
if( iWndCol >= 0 && iWndRow >= 0 &&
iWndRow < s_windows[ iWindow ]->iHeight &&
iWndCol < s_windows[ iWindow ]->iWidth )
iWndRow < iWndHeight &&
iWndCol < iWndWidth )
{
long lIndex = ( long ) iWndRow * s_windows[ iWindow ]->iWidth + iWndCol;