[libr] Fix loop counter in removeObjectNoRelease

It would do 4G iterations if count was 0.
This commit is contained in:
Bill Currie 2020-03-30 16:25:54 +09:00
parent 6d3fadfe6e
commit 0a63d0a0de

View file

@ -20,14 +20,14 @@
local unsigned i = count;
local unsigned tmp;
do {
if (_objs[--i] == anObject) {
while (i-- > 0) {
if (_objs[i] == anObject) {
for (tmp = i; tmp < count - 1; tmp++) {
_objs[tmp] = _objs[tmp + 1];
}
count--;
}
} while (i);
}
}
@end