From 99bf21a14246e2fe25f29571a64c6fce6b78bb2e Mon Sep 17 00:00:00 2001 From: Pavel Charvat Date: Tue, 2 Dec 2008 12:50:59 +0100 Subject: [PATCH] Fixed a bug in mp_printf_append(). Thanks to Dan. --- ucw/mempool-fmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ucw/mempool-fmt.c b/ucw/mempool-fmt.c index 04345687..ba0e7877 100644 --- a/ucw/mempool-fmt.c +++ b/ucw/mempool-fmt.c @@ -37,7 +37,7 @@ mp_vprintf_at(struct mempool *mp, uns ofs, const char *fmt, va_list args) } else if ((uns)cnt >= mp_avail(mp) - ofs) { - ret = mp_grow(mp, cnt + 1) + ofs; + ret = mp_grow(mp, ofs + cnt + 1) + ofs; va_copy(args2, args); int cnt2 = vsnprintf(ret, cnt + 1, fmt, args2); va_end(args2); -- 2.39.2