Fixed broken linear growth allocation in cjson.
This commit is contained in:
parent
595509a7f3
commit
eae72699d0
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue