Fixed broken linear growth allocation in cjson.

This commit is contained in:
Johny Mattsson 2015-07-31 13:17:05 +10:00
parent 595509a7f3
commit eae72699d0
1 changed files with 1 additions and 1 deletions

View File

@ -151,7 +151,7 @@ static int calculate_new_size(strbuf_t *s, int len)
newsize *= -s->increment;
} else {
/* Linear sizing */
newsize = ((newsize + s->increment - 1) / s->increment) * s->increment;
newsize = (((reqsize -1) / s->increment) + 1) * s->increment;
}
return newsize;