diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-04-25 10:34:23 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-04-25 10:34:23 -0700 |
| commit | c9d1ee7cdf08f8915ed4fdd9571ecf901d074e85 (patch) | |
| tree | 38fd535bff95c22436dea886b615084d73e7cd09 /mem-pool.c | |
| parent | 9f32d8da7aa3ec577cd47b8ce6cd05895b943626 (diff) | |
| parent | 0283cd5161561b29951c00697679c10b454e541a (diff) | |
| download | git-c9d1ee7cdf08f8915ed4fdd9571ecf901d074e85.tar.xz | |
Merge branch 'rs/vsnprintf-failure-is-not-a-bug'
Demote a BUG() to an die() when the failure from vsnprintf() may
not be due to a programmer error.
* rs/vsnprintf-failure-is-not-a-bug:
don't report vsnprintf(3) error as bug
Diffstat (limited to 'mem-pool.c')
| -rw-r--r-- | mem-pool.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mem-pool.c b/mem-pool.c index 3065b12b23..a3ba38831d 100644 --- a/mem-pool.c +++ b/mem-pool.c @@ -4,6 +4,7 @@ #include "git-compat-util.h" #include "mem-pool.h" +#include "gettext.h" #define BLOCK_GROWTH_SIZE (1024 * 1024 - sizeof(struct mp_block)) @@ -122,7 +123,7 @@ static char *mem_pool_strvfmt(struct mem_pool *pool, const char *fmt, len = vsnprintf(next_free, available, fmt, cp); va_end(cp); if (len < 0) - BUG("your vsnprintf is broken (returned %d)", len); + die(_("unable to format message: %s"), fmt); size = st_add(len, 1); /* 1 for NUL */ ret = mem_pool_alloc(pool, size); |
