pike.git / src / dynamic_buffer.c

version» Context lines:

pike.git/src/dynamic_buffer.c:7:   #include "dynamic_buffer.h"   #include "stralloc.h"   #include "error.h"   #include "memory.h"      static dynamic_buffer buff;      char *low_make_buf_space(INT32 space,dynamic_buffer *buf)   {    char *ret; + #ifdef DEBUG +  if(!buf->s.str) fatal("ARRRRGH! Deadly Trap!\n"); + #endif +     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)