]> git.ozlabs.org Git - ccan/blobdiff - ccan/tal/str/str.c
take, tal, tal/path, tal/str, tal/talloc: annotate APIs with TAKES.
[ccan] / ccan / tal / str / str.c
index 83dac663f7175d6c95a21a17f3337f61e26aebc0..4b3b11aa603cf23733ec9aa24251e602c2c7723f 100644 (file)
@@ -11,7 +11,6 @@
 #include <unistd.h>
 #include <stdio.h>
 #include <ccan/str/str.h>
-#include <ccan/take/take.h>
 
 char *tal_strdup(const tal_t *ctx, const char *p)
 {
@@ -52,7 +51,7 @@ char *tal_fmt(const tal_t *ctx, const char *fmt, ...)
 static bool do_vfmt(char **buf, size_t off, const char *fmt, va_list ap)
 {
        /* A decent guess to start. */
-       size_t max = strlen(fmt) * 2;
+       size_t max = strlen(fmt) * 2 + 1;
        bool ok;
 
        for (;;) {