Skip to content

Commit c85f0a2

Browse files
committed
Merge branch 'nd/pretty-formats'
* nd/pretty-formats: pretty: Fix bug in truncation support for %>, %< and %><
2 parents a6fed65 + 980419b commit c85f0a2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

utf8.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,8 @@ void strbuf_utf8_replace(struct strbuf *sb_src, int pos, int width,
463463
w += n;
464464
}
465465
strbuf_setlen(&sb_dst, dst - sb_dst.buf);
466-
strbuf_attach(sb_src, strbuf_detach(&sb_dst, NULL),
467-
sb_dst.len, sb_dst.alloc);
466+
strbuf_swap(sb_src, &sb_dst);
467+
strbuf_release(&sb_dst);
468468
}
469469

470470
int is_encoding_utf8(const char *name)

0 commit comments

Comments
 (0)