version 1.16, 2002/06/26 08:54:18 |
version 1.16.2.1, 2003/09/16 21:20:24 |
|
|
void * |
void * |
buffer_append_space(Buffer *buffer, u_int len) |
buffer_append_space(Buffer *buffer, u_int len) |
{ |
{ |
|
u_int newlen; |
void *p; |
void *p; |
|
|
if (len > 0x100000) |
if (len > 0x100000) |
|
|
goto restart; |
goto restart; |
} |
} |
/* Increase the size of the buffer and retry. */ |
/* Increase the size of the buffer and retry. */ |
buffer->alloc += len + 32768; |
|
if (buffer->alloc > 0xa00000) |
newlen = buffer->alloc + len + 32768; |
|
if (newlen > 0xa00000) |
fatal("buffer_append_space: alloc %u not supported", |
fatal("buffer_append_space: alloc %u not supported", |
buffer->alloc); |
newlen); |
buffer->buf = xrealloc(buffer->buf, buffer->alloc); |
buffer->buf = xrealloc(buffer->buf, newlen); |
|
buffer->alloc = newlen; |
goto restart; |
goto restart; |
/* NOTREACHED */ |
/* NOTREACHED */ |
} |
} |