From 4089e29e89026f0b581155987d5f683d7635fd13 Mon Sep 17 00:00:00 2001 From: Dan Cross Date: Thu, 24 Jul 2025 14:22:18 +0000 Subject: warnings: fix warnings on newer compilers Mostly turning the crank on fixing simple warnings: arrays, for instance, can never be nil. A couple of pointers should have been initialized to `nil` before being tested. Some logic in `troff` was simplified: basically, an `if` statement had a condition that must have always been true if that section of code were being executed at all. --- src/cmd/spell/sprog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/cmd/spell') diff --git a/src/cmd/spell/sprog.c b/src/cmd/spell/sprog.c index 1627829c..846612b0 100644 --- a/src/cmd/spell/sprog.c +++ b/src/cmd/spell/sprog.c @@ -985,7 +985,7 @@ trypref(char* ep, char* a, int lev, int flag) deriv[lev+1].type += PREF; h = tryword(bp,ep,lev+1,flag); if(Set(h,NOPREF) || - ((tp->flag&IN) && inun(bp-2,h)==0)) { + ((tp->flag&IN) && bp>=(word+2) && inun(bp-2,h)==0)) { h = 0; break; } -- cgit v1.2.3