From 29f7580fc1e622340069cd6da5a15bcd24e1e72b Mon Sep 17 00:00:00 2001 From: PatR Date: Thu, 23 Jan 2025 12:01:46 -0800 Subject: [PATCH] analyzer lint for sys/unix/*.c sys/share/*.c win/tty/*.c Actually only ioctl.c for sys/share. And with all of these, only for the conditionals used by MacOS. --- sys/share/pmatchregex.c | 12 ++++++------ win/tty/wintty.c | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/share/pmatchregex.c b/sys/share/pmatchregex.c index 95dc4de11..53c5ef531 100644 --- a/sys/share/pmatchregex.c +++ b/sys/share/pmatchregex.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 pmatchregex.c $NHDT-Date: 1596498285 2020/08/03 23:44:45 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.4 $ */ +/* NetHack 3.7 pmatchregex.c $NHDT-Date: 1737691300 2025/01/23 20:01:40 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.10 $ */ /* Copyright (c) Sean Hunt 2015. */ /* NetHack may be freely redistributed. See license for details. */ @@ -59,11 +59,11 @@ regex_match(const char *s, struct nhregex *re) void regex_free(struct nhregex *re) { - if (re) { - if (re->pat) - free((genericptr_t) re->pat); - free((genericptr_t) re); - } + assert(re != NULL); /* regex_free() is declared with NONNULLPTR1 */ + + if (re->pat) + free((genericptr_t) re->pat); + free((genericptr_t) re); } /*pmatchregex.c*/ diff --git a/win/tty/wintty.c b/win/tty/wintty.c index dbdf57363..46f32d353 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 wintty.c $NHDT-Date: 1717967340 2024/06/09 21:09:00 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.410 $ */ +/* NetHack 3.7 wintty.c $NHDT-Date: 1737691300 2025/01/23 20:01:40 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.420 $ */ /* Copyright (c) David Cohrs, 1991 */ /* NetHack may be freely redistributed. See license for details. */ @@ -5107,7 +5107,7 @@ render_status(void) if (hpbar_crit_hp) repad_with_dashes(bar); bar_len = (int) strlen(bar); /* always 30 */ - tlth = bar_len + 2; + /*tlth = bar_len + 2; // not needed within this 'if'*/ attrmask = 0; /* for the second part only case: dead */ /* when at full HP, the whole title will be highlighted; when injured or dead, there will be a second portion