pike.git / src / stralloc.c

version» Context lines:

pike.git/src/stralloc.c:3170:      PMOD_EXPORT void free_string_builder(struct string_builder *s)   {    s->s->len = s->malloced;    free_string(s->s);   }      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);    if(s->known_shift == s->s->size_shift)    return low_end_shared_string(s->s);    return end_shared_string(s->s);   }      PMOD_EXPORT PCHARP MEMCHR_PCHARP(PCHARP ptr, int chr, ptrdiff_t len)   {