analyzer lint for do_wear.c, dothrow.c

This commit is contained in:
PatR
2025-01-19 11:23:05 -08:00
parent 663ab8aa89
commit d8d4f18a00
2 changed files with 5 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 do_wear.c $NHDT-Date: 1727251255 2024/09/25 08:00:55 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.191 $ */
/* NetHack 3.7 do_wear.c $NHDT-Date: 1737343372 2025/01/19 19:22:52 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.201 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
@@ -3017,7 +3017,7 @@ doddoremarm(void)
if (flags.menu_style != MENU_TRADITIONAL
|| (result = ggetobj("take off", select_off, 0, FALSE,
(unsigned *) 0)) < -1)
result = menu_remarm(result);
(void) menu_remarm(result);
if (svc.context.takeoff.mask) {
(void) strncpy(svc.context.takeoff.disrobing,

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 dothrow.c $NHDT-Date: 1709969638 2024/03/09 07:33:58 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.285 $ */
/* NetHack 3.7 dothrow.c $NHDT-Date: 1737343372 2025/01/19 19:22:52 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.300 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2013. */
/* NetHack may be freely redistributed. See license for details. */
@@ -252,6 +252,7 @@ throw_obj(struct obj *obj, int shotlimit)
gm.m_shot.n = multishot;
for (gm.m_shot.i = 1; gm.m_shot.i <= gm.m_shot.n; gm.m_shot.i++) {
twoweap = u.twoweap;
assert(obj != NULL); /* m_shot.i <= m_shot.n guarantees this */
/* split this object off from its slot if necessary */
if (obj->quan > 1L) {
otmp = splitobj(obj, 1L);
@@ -2102,6 +2103,7 @@ thitmonst(
if (!next2u)
sho_obj_return_to_u(obj);
obj = addinv(obj); /* back into your inventory */
nhUse(obj);
(void) encumber_msg();
}
return 1; /* caller doesn't need to place it */