]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/knight.c
ncurses 6.2 - patch 20211009
[ncurses.git] / test / knight.c
index bda7da38fc43967170162a98c59d816db2d52f9b..08ccf225a46ce17221bbd00e1a9f8eb01c7af9e1 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey                                *
+ * 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  *
@@ -34,7 +34,7 @@
  * Eric S. Raymond <esr@snark.thyrsus.com> July 22 1995.  Mouse support
  * added September 20th 1995.
  *
- * $Id: knight.c,v 1.47 2020/02/02 23:34:34 tom Exp $
+ * $Id: knight.c,v 1.49 2021/05/08 19:32:15 tom Exp $
  */
 
 #include <test.priv.h>
@@ -595,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;
@@ -621,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;