diff options
Diffstat (limited to 'ccan/tal/str/test/run-fmt-terminate.c')
| -rw-r--r-- | ccan/tal/str/test/run-fmt-terminate.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/ccan/tal/str/test/run-fmt-terminate.c b/ccan/tal/str/test/run-fmt-terminate.c new file mode 100644 index 0000000..374ca03 --- /dev/null +++ b/ccan/tal/str/test/run-fmt-terminate.c @@ -0,0 +1,22 @@ +#include <ccan/tal/str/str.h> +#include <stdlib.h> +#include <stdio.h> +#include <ccan/tal/str/str.c> +#include <ccan/tap/tap.h> +#include "helper.h" + +/* Empty format string: should still terminate! */ +int main(void) +{ + char *str; + const char *fmt = ""; + + plan_tests(1); + /* GCC complains about empty format string, complains about non-literal + * with no args... */ + str = tal_fmt(NULL, fmt, ""); + ok1(!strcmp(str, "")); + tal_free(str); + + return exit_status(); +} |
