Pierre Habouzit schrieb: > +void strbuf_insert(struct strbuf *sb, size_t pos, const void *data, size_t len) { > + strbuf_grow(sb, len); > + if (pos >= sb->len) { > + sb->len = pos; Did you mean "pos = sb->len;", i.e. append without creating a hole in the string? The statement as is has no effect because sb->len is not used until the strbuf_setlen() at the end. > + } else { > + memmove(sb->buf + pos + len, sb->buf + pos, sb->len - pos); > + } > + memcpy(sb->buf + pos, data, len); > + strbuf_setlen(sb, sb->len + len); > +} - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html