ccan/tal: always include a length field.
[ccan] / ccan / tal / str / test / run-fmt-terminate.c
1 #include <ccan/tal/str/str.h>
2 #include <stdlib.h>
3 #include <stdio.h>
4 #include <ccan/tal/str/str.c>
5 #include <ccan/tap/tap.h>
6 #include "helper.h"
7
8 /* Empty format string: should still terminate! */
9 int main(void)
10 {
11         char *str;
12         const char *fmt = "";
13
14         plan_tests(1);
15         /* GCC complains about empty format string, complains about non-literal
16          * with no args... */
17         str = tal_fmt(NULL, fmt, "");
18         ok1(!strcmp(str, ""));
19         tal_free(str);
20
21         return exit_status();
22 }