X-Git-Url: https://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=test%2Fknight.c;h=08ccf225a46ce17221bbd00e1a9f8eb01c7af9e1;hb=f399f54c6c4ea2143afcbf704ce9af0be52b63fc;hp=dc04944acd73a593213d977d2aa995a71f2dc67c;hpb=efa78d11c3ea7f51c7078b64a34c98b44ecb0e1a;p=ncurses.git diff --git a/test/knight.c b/test/knight.c index dc04944a..08ccf225 100644 --- a/test/knight.c +++ b/test/knight.c @@ -1,5 +1,6 @@ /**************************************************************************** - * Copyright (c) 1998-2018,2019 Free Software Foundation, Inc. * + * Copyright 2018-2020,2021 Thomas E. Dickey * + * Copyright 1998-2013,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -33,7 +34,7 @@ * Eric S. Raymond July 22 1995. Mouse support * added September 20th 1995. * - * $Id: knight.c,v 1.46 2019/08/24 22:40:52 tom Exp $ + * $Id: knight.c,v 1.49 2021/05/08 19:32:15 tom Exp $ */ #include @@ -594,8 +595,8 @@ play(void) { bool keyhelp; /* TRUE if keystroke help is up */ int i, j, count; - int lastcol = 0; /* last location visited */ - int lastrow = 0; + int lastcol; /* last location visited */ + int lastrow; int ny = 0, nx = 0; int review = 0; /* review history */ int test_size; @@ -620,10 +621,10 @@ play(void) for (i = 0; i < ylimit; i++) { for (j = 0; j < xlimit; j++) { - squares[i][j] = FALSE; unmarkcell(i, j); } } + memset(squares, 0, sizeof(squares)); memset(history, 0, sizeof(history)); history[0].y = history[0].x = -1; history[1].y = history[1].x = -1;