Skip to content

Commit 886932e

Browse files
committed
Merge branch 'jc/maint-strbuf-add-fix-doubling'
* jc/maint-strbuf-add-fix-doubling: strbuf_addbuf(): allow passing the same buf to dst and src
2 parents 71b3ef1 + 81d2cae commit 886932e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

strbuf.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ static inline void strbuf_addstr(struct strbuf *sb, const char *s) {
104104
strbuf_add(sb, s, strlen(s));
105105
}
106106
static inline void strbuf_addbuf(struct strbuf *sb, const struct strbuf *sb2) {
107+
strbuf_grow(sb, sb2->len);
107108
strbuf_add(sb, sb2->buf, sb2->len);
108109
}
109110
extern void strbuf_adddup(struct strbuf *sb, size_t pos, size_t len);

0 commit comments

Comments
 (0)