diff options
author | dholland <dholland@NetBSD.org> | 2012-10-13 19:58:53 +0000 |
---|---|---|
committer | dholland <dholland@NetBSD.org> | 2012-10-13 19:58:53 +0000 |
commit | a1c2e76b84c58dfbb5e5b262ddcd1f4ff356e0e9 (patch) | |
tree | b98ee2665768d898cbb7a5e52dbcdb4d88bffd99 /battlestar | |
parent | 67b7a08fe1578524c0d9a942cf81f7ffa6589687 (diff) | |
download | bsdgames-darwin-a1c2e76b84c58dfbb5e5b262ddcd1f4ff356e0e9.tar.gz bsdgames-darwin-a1c2e76b84c58dfbb5e5b262ddcd1f4ff356e0e9.tar.zst bsdgames-darwin-a1c2e76b84c58dfbb5e5b262ddcd1f4ff356e0e9.zip |
Pass -Wstrict-overflow.
Diffstat (limited to 'battlestar')
-rw-r--r-- | battlestar/fly.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/battlestar/fly.c b/battlestar/fly.c index 6affb9d6..85175b6f 100644 --- a/battlestar/fly.c +++ b/battlestar/fly.c @@ -1,4 +1,4 @@ -/* $NetBSD: fly.c,v 1.14 2007/12/15 19:44:39 perry Exp $ */ +/* $NetBSD: fly.c,v 1.15 2012/10/13 19:58:53 dholland Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,13 +34,14 @@ #if 0 static char sccsid[] = "@(#)fly.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: fly.c,v 1.14 2007/12/15 19:44:39 perry Exp $"); +__RCSID("$NetBSD: fly.c,v 1.15 2012/10/13 19:58:53 dholland Exp $"); #endif #endif /* not lint */ #include "extern.h" #undef UP #include <curses.h> +#include <assert.h> #define MIDR (LINES/2 - 1) #define MIDC (COLS/2 - 1) @@ -150,8 +151,8 @@ visual(void) if (torps) { torps -= 2; blast(); - if (row == MIDR && column - MIDC < 2 && - MIDC - column < 2) { + if (row == MIDR && column < MIDC + 2 && + column > MIDC - 2) { destroyed = 1; alarm(0); } |