Commit 377395cf authored by Rusty Russell's avatar Rusty Russell

str_talloc: avoid const warnings on test/run.c

parent b0fa019a
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0])) #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))
static char *substrings[] = { "far", "bar", "baz", "b", "ba", "z", "ar", NULL }; static const char *substrings[]
= { "far", "bar", "baz", "b", "ba", "z", "ar", NULL };
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
...@@ -36,10 +37,10 @@ int main(int argc, char *argv[]) ...@@ -36,10 +37,10 @@ int main(int argc, char *argv[])
ok1(talloc_parent(split) == ctx); ok1(talloc_parent(split) == ctx);
talloc_free(ctx); talloc_free(ctx);
str = strjoin(NULL, substrings, ", "); str = strjoin(NULL, (char **)substrings, ", ");
ok1(!strcmp(str, "far, bar, baz, b, ba, z, ar, ")); ok1(!strcmp(str, "far, bar, baz, b, ba, z, ar, "));
ctx = str; ctx = str;
str = strjoin(ctx, substrings, ""); str = strjoin(ctx, (char **)substrings, "");
ok1(!strcmp(str, "farbarbazbbazar")); ok1(!strcmp(str, "farbarbazbbazar"));
ok1(talloc_parent(str) == ctx); ok1(talloc_parent(str) == ctx);
talloc_free(ctx); talloc_free(ctx);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment