From 9bcb365abd6ec10013c806666d21f016ff7105df Mon Sep 17 00:00:00 2001 From: Tim Segers Date: Tue, 3 Jan 2023 18:52:27 +0100 Subject: Fix --licenses mangling unicode --- src/opendeco-cli.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/opendeco-cli.c b/src/opendeco-cli.c index f9f510e..481ef66 100644 --- a/src/opendeco-cli.c +++ b/src/opendeco-cli.c @@ -10,13 +10,14 @@ #include "toml/LICENSE.h" #include "minunit/LICENSE.h" -#define print_xxd_arr(name, arrname) \ - do { \ - wprintf(L"--------\n\n"); \ - wprintf(L"License for: %s\n\n", name); \ - for (int i = 0; i < arrname##_len; i++) \ - putwchar(arrname[i]); \ - wprintf(L"\n"); \ +#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[] = ""; -- cgit v1.2.3-70-g09d2