aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2017-05-31 14:57:24 +0200
committerLeah Neukirchen <leah@vuxu.org>2017-05-31 14:57:24 +0200
commitb2e97e6cfe87ee4e6accf4ac3cfa94c9c4e00c1c (patch)
treefb7c57f18d4d9f730128ecc5b4887f596e8c7d74
parent1fbebe4d166b036e7d5427775ef3239addcffb2f (diff)
downloadmblaze-b2e97e6cfe87ee4e6accf4ac3cfa94c9c4e00c1c.tar.gz
mscan: use wint_t for %lc
%lc arguments in fprintf are of type wint_t, not wchar_t. Reported by Léo Villeveygoux.
-rw-r--r--mscan.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mscan.c b/mscan.c
index d981ace..67a4c1d 100644
--- a/mscan.c
+++ b/mscan.c
@@ -46,7 +46,7 @@ u8putstr(FILE *out, char *s, ssize_t l, int pad)
s++;
l--;
} else if ((unsigned)*s < 32 || *s == 127) { // C0
- fprintf(out, "%lc", *s == 127 ? 0x2421 : 0x2400+*s);
+ fprintf(out, "%lc", (wint_t)(*s == 127 ? 0x2421 : 0x2400+*s));
s++;
l--;
} else {
@@ -59,7 +59,7 @@ u8putstr(FILE *out, char *s, ssize_t l, int pad)
s += r;
l -= wcwidth(wc);
if (l >= 0)
- fprintf(out, "%lc", wc);
+ fprintf(out, "%lc", (wint_t)wc);
}
}
if (pad)