pike.git / src / dynamic_buffer.c

version» Context lines:

pike.git/src/dynamic_buffer.c:9:   #include "error.h"   #include "memory.h"      static dynamic_buffer buff;      char *low_make_buf_space(INT32 space,dynamic_buffer *buf)   {    char *ret;    if(buf->s.len+space>=buf->bufsize)    { +  if(!buf->bufsize) buf->bufsize=1; +     do{    buf->bufsize*=2;    }while(buf->s.len+space>=buf->bufsize);       buf->s.str=(char *)realloc(buf->s.str,buf->bufsize);    if(!buf->s.str)    error("Out of memory.\n");    }    ret=buf->s.str + buf->s.len;    buf->s.len+=space;