aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/spell
diff options
context:
space:
mode:
authorDan Cross <cross@gajendra.net>2025-07-24 14:22:18 +0000
committerDan Cross <cross@gajendra.net>2025-07-24 15:45:31 +0000
commit4089e29e89026f0b581155987d5f683d7635fd13 (patch)
tree168b0306e87f3a7c1c42f81e656cf0054add7371 /src/cmd/spell
parent564d45b5a55adeb48f69fdecb2bf4ed1f909850b (diff)
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.
Diffstat (limited to 'src/cmd/spell')
-rw-r--r--src/cmd/spell/sprog.c2
1 files changed, 1 insertions, 1 deletions
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;
}