From 88e194d059d74d23cd8b556a4c07af03cc09c294 Mon Sep 17 00:00:00 2001 From: "Gregory J. Ward" Date: Fri, 6 Dec 2024 20:30:15 +0000 Subject: [PATCH] fix: Fixed potential bug in 64-bit machines with 32-bit integers --- src/common/modobject.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/modobject.c b/src/common/modobject.c index e5e9251e7..3863568d8 100644 --- a/src/common/modobject.c +++ b/src/common/modobject.c @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: modobject.c,v 2.20 2021/02/01 17:36:45 greg Exp $"; +static const char RCSid[] = "$Id: modobject.c,v 2.21 2024/12/06 20:30:15 greg Exp $"; #endif /* * Routines for tracking object modifiers @@ -30,14 +30,14 @@ objndx( /* get object number from pointer */ ) { int i; - long j; + ssize_t j; for (i = (nobjects-1)>>OBJBLKSHFT; i >= 0; i--) { j = op - objblock[i]; - if ((j >= 0) & (j < OBJBLKSIZ)) + if ((0 <= j) & (j < OBJBLKSIZ)) return(((OBJECT)i<