From 52940a462032a5e7c3b0e223e1f47a5147f35518 Mon Sep 17 00:00:00 2001 From: nhmall Date: Mon, 8 Jan 2024 23:59:41 -0500 Subject: [PATCH] inappropriate null sobj check - pull request 1173 --- doc/fixes3-7-0.txt | 3 +++ include/extern.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 1bede7645..4a604c098 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -2614,6 +2614,9 @@ add new options 'nopick_dropped' and 'pickup_stolen' options to avoid previously stolen from hero if moved upon while autopickup is On; both bypass pickup_types and autopickup_exceptions (pr #1140 by entrez) fix msg_window:combination and TTY getlin() ^P (pr #1155 by entrez) +remove a null sobj check from gold_detect that was situated after + dereferences had already been done (pr #1173 by argrath) and + adjust prototype in extern.h Code Cleanup and Reorganization diff --git a/include/extern.h b/include/extern.h index 45880d68c..6125a3eb4 100644 --- a/include/extern.h +++ b/include/extern.h @@ -410,7 +410,7 @@ extern boolean trapped_chest_at(int, coordxy, coordxy); extern boolean trapped_door_at(int, coordxy, coordxy); extern struct obj *o_in(struct obj *, char) NONNULLARG1; extern struct obj *o_material(struct obj *, unsigned) NONNULLARG1; -extern int gold_detect(struct obj *); +extern int gold_detect(struct obj *) NONNULLARG1; extern int food_detect(struct obj *); extern int object_detect(struct obj *, int); extern int monster_detect(struct obj *, int);