X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Fknight.c;h=2835cd8b8d4689707dc07de372b6ef1c38b304ba;hp=d9f81facacec814e13cdb984975523867b7cbc13;hb=98d8891f42d8acac5c2ade39d163f386057a22e4;hpb=da2e96ef7073a13477fe57144926dd159e6089c0 diff --git a/test/knight.c b/test/knight.c index d9f81fac..2835cd8b 100644 --- a/test/knight.c +++ b/test/knight.c @@ -33,7 +33,7 @@ * Eric S. Raymond July 22 1995. Mouse support * added September 20th 1995. * - * $Id: knight.c,v 1.31 2010/11/13 20:44:21 tom Exp $ + * $Id: knight.c,v 1.32 2012/11/17 23:46:31 tom Exp $ */ #include @@ -614,8 +614,8 @@ play(void) ny = history[movecount].y; nx = history[movecount].x; if (nx < 0 || ny < 0) { - ny = lastrow; - nx = lastcol; + ny = (lastrow >= 0) ? lastrow : 0; + nx = (lastcol >= 0) ? lastcol : 0; } movecount = 0; board[ny][nx] = FALSE;