X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucw%2Fmempool-fmt.c;h=4f81dd8b21a8857750755281ae032687ab72f0a0;hb=ecf11d9c9949a6e9323a4f18c2418532d7f77b8f;hp=04345687f85e7f597c741b1ca214d6afbb44d91b;hpb=ad920945145a18895ef391511c92ef42e0e4c3d7;p=libucw.git diff --git a/ucw/mempool-fmt.c b/ucw/mempool-fmt.c index 04345687..4f81dd8b 100644 --- a/ucw/mempool-fmt.c +++ b/ucw/mempool-fmt.c @@ -8,8 +8,8 @@ * of the GNU Lesser General Public License. */ -#include "ucw/lib.h" -#include "ucw/mempool.h" +#include +#include #include #include @@ -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);