aboutsummaryrefslogtreecommitdiffstats
path: root/games
diff options
context:
space:
mode:
authorjbeich <jbeich@FreeBSD.org>2016-12-20 09:51:59 +0800
committerjbeich <jbeich@FreeBSD.org>2016-12-20 09:51:59 +0800
commit1830761d87bfdf9695018c062b628d8b39c8293f (patch)
tree7faca831c6f8956f64f2b92ff1f968cb9b81d54d /games
parent5d16e151d9ec26d12a78ff41c0cf8bde62f4fbf6 (diff)
downloadfreebsd-ports-gnome-1830761d87bfdf9695018c062b628d8b39c8293f.tar.gz
freebsd-ports-gnome-1830761d87bfdf9695018c062b628d8b39c8293f.tar.zst
freebsd-ports-gnome-1830761d87bfdf9695018c062b628d8b39c8293f.zip
games/openbor: fix off-by-one noticed by gcc6
openbor.c: In function 'common_dot': openbor.c:20485:39: warning: iteration 10 invokes undefined behavior [-Waggressive-loop-optimizations] iDot_time = self->dot_time[iIndex]; //Get expire time. ~~~~~~~~~~~~~~^~~~~~~~ openbor.c:20483:5: note: within this loop for(iIndex = 0; iIndex <= MAX_DOTS; iIndex++) //Loop through all DOT indexes. ^~~
Diffstat (limited to 'games')
-rw-r--r--games/openbor/Makefile2
-rw-r--r--games/openbor/files/patch-openbor.c9
2 files changed, 10 insertions, 1 deletions
diff --git a/games/openbor/Makefile b/games/openbor/Makefile
index 3d50e242ed70..54e222e92f9c 100644
--- a/games/openbor/Makefile
+++ b/games/openbor/Makefile
@@ -2,7 +2,7 @@
PORTNAME= openbor
PORTVERSION= 3.0.r4415
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= games devel
MASTER_SITES= LOCAL/jbeich \
https://svn.code.sf.net/p/${PORTNAME}/engine/engine/:svn
diff --git a/games/openbor/files/patch-openbor.c b/games/openbor/files/patch-openbor.c
index d3af726c1212..4f1f134acf0b 100644
--- a/games/openbor/files/patch-openbor.c
+++ b/games/openbor/files/patch-openbor.c
@@ -18,6 +18,15 @@
// Allocate memory and get pointer.
result = malloc(alloc_size);
+@@ -20480,7 +20480,7 @@ void common_dot()
+ entity *eOpp; //Owner of dot effect.
+ s_collision_attack attack; //Attack struct.
+
+- for(iIndex = 0; iIndex <= MAX_DOTS; iIndex++) //Loop through all DOT indexes.
++ for(iIndex = 0; iIndex < MAX_DOTS; iIndex++) //Loop through all DOT indexes.
+ {
+ iDot_time = self->dot_time[iIndex]; //Get expire time.
+ iDot_cnt = self->dot_cnt[iIndex]; //Get next tick time.
@@ -34617,7 +34617,7 @@ void keyboard_setup(int player)
strncpy(buttonnames[SDID_SPECIAL], "Special", 16);
strncpy(buttonnames[SDID_START], "Start", 16);