Merge branch 'js/use-bug-macro'
Developer support update, by using BUG() macro instead of die() to mark codepaths that should not happen more clearly. * js/use-bug-macro: BUG_exit_code: fix sparse "symbol not declared" warning Convert remaining die*(BUG) messages Replace all die("BUG: ...") calls by BUG() ones run-command: use BUG() to report bugs, not die() test-tool: help verifying BUG() code paths
This commit is contained in:
4
strbuf.c
4
strbuf.c
@ -334,12 +334,12 @@ void strbuf_vaddf(struct strbuf *sb, const char *fmt, va_list ap)
|
||||
len = vsnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, cp);
|
||||
va_end(cp);
|
||||
if (len < 0)
|
||||
die("BUG: your vsnprintf is broken (returned %d)", len);
|
||||
BUG("your vsnprintf is broken (returned %d)", len);
|
||||
if (len > strbuf_avail(sb)) {
|
||||
strbuf_grow(sb, len);
|
||||
len = vsnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, ap);
|
||||
if (len > strbuf_avail(sb))
|
||||
die("BUG: your vsnprintf is broken (insatiable)");
|
||||
BUG("your vsnprintf is broken (insatiable)");
|
||||
}
|
||||
strbuf_setlen(sb, sb->len + len);
|
||||
}
|
||||
|
Reference in New Issue
Block a user