From 2ec11a8d96725acb6e3be5bc6bd03004924385fe Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Sun, 15 Sep 2013 21:35:35 +0000 Subject: [PATCH] Test limits before accessing the array (coverity) --- examples/conio.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/examples/conio.c b/examples/conio.c index 4314b8d..8ebbe9c 100644 --- a/examples/conio.c +++ b/examples/conio.c @@ -150,40 +150,40 @@ BOOLEAN isWon(int who, int xsquare[Y_BOARD][X_BOARD]) for(y=0; y=0 && + xsquare[y][x] == who && xsquare[y-1][x+1] == who && xsquare[y-2][x+2] == who && - xsquare[y-3][x+3] == who && - (x+3)=0 + xsquare[y-3][x+3] == who ) return TRUE; }