aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorGravatar Tim Segers <tsegers@pm.me>2023-01-03 18:52:27 +0100
committerGravatar Tim Segers <tsegers@pm.me>2023-01-07 15:24:51 +0100
commit9bcb365abd6ec10013c806666d21f016ff7105df (patch)
tree28a6e93caf71c4157a75601c1b3a232dcde992f6
parentd07c4f1a29732f3901d7a9d3c43cecf0a7eee657 (diff)
downloadopendeco-9bcb365abd6ec10013c806666d21f016ff7105df.tar.gz
Fix --licenses mangling unicode
-rw-r--r--src/opendeco-cli.c15
1 files 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[] = "";