summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormickey <mickey@openbsd.org>2004-09-17 21:07:26 +0000
committermickey <mickey@openbsd.org>2004-09-17 21:07:26 +0000
commit9f65b850779efbee69483c1ad6653806134e3189 (patch)
tree29414b6f64d117197a67f2244ebb94b20e3d5037
parentcorrect comment: spamd flags in spamd(8), not spamd-setup(8); (diff)
downloadwireguard-openbsd-9f65b850779efbee69483c1ad6653806134e3189.tar.xz
wireguard-openbsd-9f65b850779efbee69483c1ad6653806134e3189.zip
dothrow() calls bhit() w/ both null hit functions thus have to check before calling those; from Juha Erkkila <erkkila@cc.jyu.fi>; pr3923
-rw-r--r--games/hack/hack.zap.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/games/hack/hack.zap.c b/games/hack/hack.zap.c
index f3f4325be4e..1695734aa0d 100644
--- a/games/hack/hack.zap.c
+++ b/games/hack/hack.zap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hack.zap.c,v 1.8 2003/05/19 09:00:54 pjanzen Exp $ */
+/* $OpenBSD: hack.zap.c,v 1.9 2004/09/17 21:07:26 mickey Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -62,7 +62,7 @@
*/
#ifndef lint
-static const char rcsid[] = "$OpenBSD: hack.zap.c,v 1.8 2003/05/19 09:00:54 pjanzen Exp $";
+static const char rcsid[] = "$OpenBSD: hack.zap.c,v 1.9 2004/09/17 21:07:26 mickey Exp $";
#endif /* not lint */
#include <stdlib.h>
@@ -390,11 +390,12 @@ bhit(int ddx, int ddy, int range, char sym,
tmp_at(-1, -1); /* close call */
return(mtmp);
}
- (*fhitm)(mtmp, obj);
+ if (fhitm)
+ (*fhitm)(mtmp, obj);
range -= 3;
}
if ((otmp = o_at(bhitpos.x,bhitpos.y))){
- if((*fhito)(otmp, obj))
+ if(fhito && (*fhito)(otmp, obj))
range--;
}
if (!ZAP_POS(typ)) {