mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-09 22:00:39 +01:00
fix memory corruption on 64-bit systems
This commit is contained in:
parent
abb8da44ba
commit
093a260f1d
1 changed files with 3 additions and 3 deletions
|
@ -562,12 +562,12 @@ DrawCtx*
|
||||||
cursesDrawCtxtMake( WINDOW* boardWin )
|
cursesDrawCtxtMake( WINDOW* boardWin )
|
||||||
{
|
{
|
||||||
CursesDrawCtx* dctx = malloc( sizeof(CursesDrawCtx) );
|
CursesDrawCtx* dctx = malloc( sizeof(CursesDrawCtx) );
|
||||||
short i;
|
int ii;
|
||||||
|
|
||||||
dctx->vtable = malloc( sizeof(*(((CursesDrawCtx*)dctx)->vtable)) );
|
dctx->vtable = malloc( sizeof(*(((CursesDrawCtx*)dctx)->vtable)) );
|
||||||
|
|
||||||
for ( i = 0; i < sizeof(*dctx->vtable)/4; ++i ) {
|
for ( ii = 0; ii < VSIZE(dctx->vtable); ++ii ) {
|
||||||
((void**)(dctx->vtable))[i] = draw_doNothing;
|
((void**)(dctx->vtable))[ii] = draw_doNothing;
|
||||||
}
|
}
|
||||||
|
|
||||||
SET_VTABLE_ENTRY( dctx->vtable, draw_destroyCtxt, curses );
|
SET_VTABLE_ENTRY( dctx->vtable, draw_destroyCtxt, curses );
|
||||||
|
|
Loading…
Add table
Reference in a new issue