(overlays_in): Handle extending vec from length 0 as in overlays_at.
{
if (extend)
{
- *len_ptr = len *= 2;
+ /* Make it work with an initial len == 0. */
+ len *= 2;
if (len == 0)
- len = *len_ptr = 4;
+ len = 4;
+ *len_ptr = len;
vec = (Lisp_Object *) xrealloc (vec, len * sizeof (Lisp_Object));
*vec_ptr = vec;
}
Either make it bigger, or don't store any more in it. */
if (extend)
{
- *len_ptr = len *= 2;
+ /* Make it work with an initial len == 0. */
+ len *= 2;
+ if (len == 0)
+ len = 4;
+ *len_ptr = len;
vec = (Lisp_Object *) xrealloc (vec, len * sizeof (Lisp_Object));
*vec_ptr = vec;
}
{
if (extend)
{
- *len_ptr = len *= 2;
+ /* Make it work with an initial len == 0. */
+ len *= 2;
+ if (len == 0)
+ len = 4;
+ *len_ptr = len;
vec = (Lisp_Object *) xrealloc (vec, len * sizeof (Lisp_Object));
*vec_ptr = vec;
}