]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/mempool-fmt.c
Opt: Earl Grey was not an American :)
[libucw.git] / ucw / mempool-fmt.c
index 04345687f85e7f597c741b1ca214d6afbb44d91b..4f81dd8b21a8857750755281ae032687ab72f0a0 100644 (file)
@@ -8,8 +8,8 @@
  *     of the GNU Lesser General Public License.
  */
 
-#include "ucw/lib.h"
-#include "ucw/mempool.h"
+#include <ucw/lib.h>
+#include <ucw/mempool.h>
 
 #include <alloca.h>
 #include <stdio.h>
@@ -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);