Branch: Tag:

2014-09-09

2014-09-09 19:11:03 by Stephen R. van den Berg <srb@cuci.nl>

Store new malloced value instead.

3177:   PMOD_EXPORT struct pike_string *finish_string_builder(struct string_builder *s)   {    ptrdiff_t len = s->s->len; -  if (len != s->malloced) { -  s->s->len = s->malloced; -  s->s = realloc_unlinked_string(s->s, len); -  } +  if (len != s->malloced) +  s->s = realloc_unlinked_string(s->s, s->malloced = len);    else    /* Ensure NUL-termination */    low_set_index(s->s,s->s->len,0);