From 2ab4ce0c5c840e08596327736786a6fb3fd8d705 Mon Sep 17 00:00:00 2001 From: Falk Werner Date: Sat, 25 May 2019 02:08:50 +0200 Subject: [PATCH] fixes crash using -h / --help arguments --- example/provider/static_filesystem.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/example/provider/static_filesystem.c b/example/provider/static_filesystem.c index ee06489..631274e 100644 --- a/example/provider/static_filesystem.c +++ b/example/provider/static_filesystem.c @@ -75,12 +75,17 @@ int main(int argc, char* argv[]) struct args args; int result = parse_args(&args, argc, argv); - if (EXIT_SUCCESS == result) + if ((EXIT_SUCCESS == result) && (!args.show_help)) { struct wfp_client_config * config = wfp_client_config_create(); struct wfp_static_filesystem * fs = wfp_static_filesystem_create(config); - wfp_static_filesystem_add_text(fs, "hello.txt", 0444, "Hello, World!"); + wfp_static_filesystem_add_text(fs, "brummni/hello_world.txt", 0444, "Hello, World!\n"); + wfp_static_filesystem_add_text(fs, "brummni/hello_bob.txt", 0444, "Hello, Bob!\n"); + wfp_static_filesystem_add_text(fs, "brummni/hello_bob.txt", 0444, "Hello, Alice!\n"); + wfp_static_filesystem_add_text(fs, "bla/hello_world.txt", 0444, "Hello, World!\n"); + wfp_static_filesystem_add_text(fs, "foo.txt", 0444, "foo\n"); + wfp_static_filesystem_add_text(fs, "bar.txt", 0444, "bar\n"); struct wfp_client * client = wfp_client_create(config); wfp_client_connect(client, args.url);