pike.git / src / stralloc.c

version» Context lines:

pike.git/src/stralloc.c:3136:      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 = realloc_unlinked_string(s->s, s->malloced = len); +  if (len != s->malloced) { +  s->s->len = s->malloced; +  s->s = realloc_unlinked_string(s->s, len); +  }    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)   {    switch(ptr.shift)    {    case 0: return MKPCHARP(memchr(ptr.ptr,chr,len),0);