Skip to content

Commit 46d699f

Browse files
avargitster
authored andcommitted
strbuf.h: use BUG(...) not die("BUG: ...")
In 7141efa (strbuf: clarify assertion in strbuf_setlen(), 2011-04-27) this 'die("BUG: "' invocation was added with the rationale that strbuf.c had existing users doing the same, but those users were later changed to use BUG() in 033abf9 (Replace all die("BUG: ...") calls by BUG() ones, 2018-05-02). Let's do the same here. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5867757 commit 46d699f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

strbuf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ void strbuf_grow(struct strbuf *sb, size_t amount);
160160
static inline void strbuf_setlen(struct strbuf *sb, size_t len)
161161
{
162162
if (len > (sb->alloc ? sb->alloc - 1 : 0))
163-
die("BUG: strbuf_setlen() beyond buffer");
163+
BUG("strbuf_setlen() beyond buffer");
164164
sb->len = len;
165165
if (sb->buf != strbuf_slopbuf)
166166
sb->buf[len] = '\0';

0 commit comments

Comments
 (0)