static analyzer lint for dig.c, do.c

This commit is contained in:
PatR
2025-01-18 19:58:30 -08:00
parent e8d9331f14
commit c97bb2c0a4
2 changed files with 3 additions and 1 deletions

View File

@@ -1642,6 +1642,7 @@ zap_dig(void)
if (diridx != DIR_ERR
&& !conjoined_pits(adjpit, trap_with_u, FALSE)) {
digdepth = 0; /* limited to the adjacent location only */
nhUse(digdepth);
if (!(adjpit && is_pit(adjpit->ttyp))) {
char buf[BUFSZ];

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 do.c $NHDT-Date: 1704225560 2024/01/02 19:59:20 $ $NHDT-Branch: keni-luabits2 $:$NHDT-Revision: 1.376 $ */
/* NetHack 3.7 do.c $NHDT-Date: 1737287889 2025/01/19 03:58:09 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.399 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
@@ -224,6 +224,7 @@ flooreffects(
}
if (!DEADMONSTER(mtmp) && !is_whirly(mtmp->data))
res = FALSE; /* still alive, boulder still intact */
nhUse(res);
}
mtmp->mtrapped = 0;
} else {