зеркало из https://github.com/microsoft/git.git
strbuf.h: use BUG(...) not die("BUG: ...")
In7141efab24
(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() in033abf97fc
(Replace all die("BUG: ...") calls by BUG() ones, 2018-05-02). Let's do the same here. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Родитель
5867757d88
Коммит
46d699f492
2
strbuf.h
2
strbuf.h
|
@ -160,7 +160,7 @@ void strbuf_grow(struct strbuf *sb, size_t amount);
|
|||
static inline void strbuf_setlen(struct strbuf *sb, size_t len)
|
||||
{
|
||||
if (len > (sb->alloc ? sb->alloc - 1 : 0))
|
||||
die("BUG: strbuf_setlen() beyond buffer");
|
||||
BUG("strbuf_setlen() beyond buffer");
|
||||
sb->len = len;
|
||||
if (sb->buf != strbuf_slopbuf)
|
||||
sb->buf[len] = '\0';
|
||||
|
|
Загрузка…
Ссылка в новой задаче