diff options
Diffstat (limited to 'strbuf.c')
-rw-r--r-- | strbuf.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -152,9 +152,7 @@ void strbuf_resize(strbuf_t *s, int len) | |||
152 | 152 | ||
153 | void strbuf_append_mem(strbuf_t *s, const char *c, int len) | 153 | void strbuf_append_mem(strbuf_t *s, const char *c, int len) |
154 | { | 154 | { |
155 | if (len > strbuf_empty_length(s)) | 155 | strbuf_ensure_empty_length(s, len); |
156 | strbuf_resize(s, s->length + len); | ||
157 | |||
158 | memcpy(s->buf + s->length, c, len); | 156 | memcpy(s->buf + s->length, c, len); |
159 | s->length += len; | 157 | s->length += len; |
160 | } | 158 | } |