diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2017-06-01 11:06:16 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2017-06-01 11:15:12 +0200 |
| commit | c2568c171065a04911b4cae17a1adf471ed2bd95 (patch) | |
| tree | f60f6c1914816b492443f04b9625af3510b29050 /main.c | |
| parent | bd5f93d6a4338f2026a9d9ba9bf81cfdb7575deb (diff) | |
| download | vis-c2568c171065a04911b4cae17a1adf471ed2bd95.tar.gz vis-c2568c171065a04911b4cae17a1adf471ed2bd95.tar.xz | |
vis: use more portable format string for wchar_t
Use upper case Unicode (U+XXXX) notation for `ga`.
Fix #568
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -6,6 +6,7 @@ #include <ctype.h> #include <errno.h> #include <fcntl.h> +#include <inttypes.h> #include <sys/stat.h> #include <sys/types.h> @@ -2004,7 +2005,7 @@ static const char *unicode_info(Vis *vis, const char *keys, const Arg *arg) { else buffer_appendf(&info, "<%s%.*s> ", combining ? " " : "", (int)len, codepoint); if (arg->i == VIS_ACTION_UNICODE_INFO) { - buffer_appendf(&info, "U+%04x ", wc); + buffer_appendf(&info, "U+%04"PRIX32" ", (uint32_t)wc); } else { for (size_t i = 0; i < len; i++) buffer_appendf(&info, "%02x ", (uint8_t)codepoint[i]); |
