Skip to content

Commit

Permalink
fix: Fixed potential bug in 64-bit machines with 32-bit integers
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregungory committed Dec 6, 2024
1 parent 6f823f6 commit 88e194d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/common/modobject.c
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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<<OBJBLKSHFT) + (OBJECT)j);
}
return(OVOID);
return(OVOID); /* not in our array -- may still be valid */
}


Expand Down

0 comments on commit 88e194d

Please # to comment.