summaryrefslogtreecommitdiff
path: root/src/common/db.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/db.h')
-rw-r--r--src/common/db.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/db.h b/src/common/db.h
index afec62d86..1df306038 100644
--- a/src/common/db.h
+++ b/src/common/db.h
@@ -1175,7 +1175,7 @@ HPShared struct db_interface *DB;
/* reduce size */ \
VECTOR_DATA(_vec) = aRealloc(VECTOR_DATA(_vec), (_n)*sizeof(VECTOR_FIRST(_vec))); /* reallocate */ \
VECTOR_CAPACITY(_vec) = (_n); /* update capacity */ \
- if (VECTOR_LENGTH(_vec) > (_n)) \
+ if ((_n) - VECTOR_LENGTH(_vec) > 0) \
VECTOR_LENGTH(_vec) = (_n); /* update length */ \
} \
} while(false)