diff options
-rw-r--r-- | src/opendeco-cli.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/opendeco-cli.c b/src/opendeco-cli.c index 481ef66..5f6b627 100644 --- a/src/opendeco-cli.c +++ b/src/opendeco-cli.c @@ -10,16 +10,6 @@ #include "toml/LICENSE.h" #include "minunit/LICENSE.h" -#define print_xxd_arr(name, arrname) \ - do { \ - char *tmp = strndup((const char *) arrname, arrname##_len); \ - wprintf(L"--------\n\n"); \ - wprintf(L"License for: %s\n\n", name); \ - wprintf(L"%s", tmp); \ - wprintf(L"\n"); \ - free(tmp); \ - } while (0) - static char args_doc[] = ""; static char doc[] = "Implementation of Buhlmann ZH-L16 with Gradient Factors:" "\vExamples:\n\n" @@ -51,11 +41,23 @@ static struct argp_option options[] = { {0, 0, 0, 0, 0, 0 } }; +static void print_xxd_arr(char *name, unsigned char *content, unsigned int len) +{ + char *tmp = strndup((const char *) content, len); + + wprintf(L"--------\n\n"); + wprintf(L"License for: %s\n\n", name); + wprintf(L"%s", tmp); + wprintf(L"\n"); + + free(tmp); +} + static void print_licenses() { wprintf(L"THIRD-PARTY LICENSES:\n\n"); - print_xxd_arr("cktan/tomlc99", toml_LICENSE); - print_xxd_arr("siu/minunit", minunit_LICENSE); + print_xxd_arr("cktan/tomlc99", toml_LICENSE, toml_LICENSE_len); + print_xxd_arr("siu/minunit", minunit_LICENSE, minunit_LICENSE_len); } static error_t parse_opt(int key, char *arg, struct argp_state *state) |