|
Lines 78-85
Link Here
|
| 78 |
u_int newlen; |
78 |
u_int newlen; |
| 79 |
void *p; |
79 |
void *p; |
| 80 |
|
80 |
|
| 81 |
if (len > BUFFER_MAX_CHUNK) |
81 |
if (len > BUFFER_MAX_CHUNK) { |
| 82 |
fatal("buffer_append_space: len %u not supported", len); |
82 |
error("buffer_append_space: len %u not supported", len); |
|
|
83 |
abort(); |
| 84 |
} |
| 83 |
|
85 |
|
| 84 |
/* If the buffer is empty, start using it from the beginning. */ |
86 |
/* If the buffer is empty, start using it from the beginning. */ |
| 85 |
if (buffer->offset == buffer->end) { |
87 |
if (buffer->offset == buffer->end) { |
|
Lines 107-115
Link Here
|
| 107 |
/* Increase the size of the buffer and retry. */ |
109 |
/* Increase the size of the buffer and retry. */ |
| 108 |
|
110 |
|
| 109 |
newlen = buffer->alloc + len + 32768; |
111 |
newlen = buffer->alloc + len + 32768; |
| 110 |
if (newlen > BUFFER_MAX_LEN) |
112 |
if (newlen > BUFFER_MAX_LEN) { |
| 111 |
fatal("buffer_append_space: alloc %u not supported", |
113 |
error("buffer_append_space: alloc %u not supported", |
| 112 |
newlen); |
114 |
newlen); |
|
|
115 |
abort(); |
| 116 |
} |
| 113 |
buffer->buf = xrealloc(buffer->buf, newlen); |
117 |
buffer->buf = xrealloc(buffer->buf, newlen); |
| 114 |
buffer->alloc = newlen; |
118 |
buffer->alloc = newlen; |
| 115 |
goto restart; |
119 |
goto restart; |