]> git.ozlabs.org Git - ccan/blob - ccan/tal/str/test/run-strndup.c
Remove unused main() args in many modules.
[ccan] / ccan / tal / str / test / run-strndup.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 int main(void)
9 {
10         char *str, *copy;
11
12         plan_tests(1);
13         str = malloc(5);
14         memcpy(str, "hello", 5);
15         /* We should be fine to strndup src without nul terminator. */
16         copy = tal_strndup(NULL, str, 5);
17         ok1(!strcmp(copy, "hello"));
18         tal_free(copy);
19         free(str);
20
21         return exit_status();
22 }