Merge pull request #2741 from kmiku7/unstable

fix boundary case for _dictNextPower
This commit is contained in:
Salvatore Sanfilippo 2017-11-08 17:06:09 +01:00 committed by GitHub
commit cf9a3f7048
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -940,7 +940,7 @@ static unsigned long _dictNextPower(unsigned long size)
{ {
unsigned long i = DICT_HT_INITIAL_SIZE; unsigned long i = DICT_HT_INITIAL_SIZE;
if (size >= LONG_MAX) return LONG_MAX; if (size >= LONG_MAX) return LONG_MAX + 1LU;
while(1) { while(1) {
if (i >= size) if (i >= size)
return i; return i;