1 // class cl_spushstring.
7 #include "cl_spushstring.h"
12 #include <cstring> // declares memcpy()
16 void cl_spushstring::append (const char * ptr, uintL len)
18 if (index + len > alloc) {
19 var uintL newalloc = index+2*len;
20 if (newalloc < 2*alloc) { newalloc = 2*alloc; }
21 var char* newbuffer = (char *) malloc_hook(newalloc);
22 memcpy(newbuffer,buffer,alloc);
27 // Now index+len <= alloc.
28 for (uintL count = len; count > 0; count--)
29 buffer[index++] = *ptr++;