summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2013-05-19 00:12:52 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2013-05-19 00:12:52 +0200
commitcaac68a3ed74501f97c5d67bd5e6280542c87cfe (patch)
tree99ca5ff67dbc1998cc1250ac6155923cae8a4f84
parentc09e3dcc9631ed9db9fbffa96e54e1f34766ce90 (diff)
downloadtdv-caac68a3ed74501f97c5d67bd5e6280542c87cfe.tar.gz
tdv-caac68a3ed74501f97c5d67bd5e6280542c87cfe.tar.xz
tdv-caac68a3ed74501f97c5d67bd5e6280542c87cfe.zip
Fix characters not representable in LC_CTYPE
-rw-r--r--src/sdtui.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/sdtui.c b/src/sdtui.c
index eb6034c..cf1c315 100644
--- a/src/sdtui.c
+++ b/src/sdtui.c
@@ -350,7 +350,7 @@ app_add_utf8_string (Application *self, const gchar *str, int n)
g_return_val_if_fail (wide_str != NULL, 0);
ssize_t wide_len = wcslen (wide_str);
- wchar_t padding = L' ';
+ wchar_t padding = L' ', error = L'?';
if (n < 0)
n = wide_len;
@@ -359,8 +359,9 @@ app_add_utf8_string (Application *self, const gchar *str, int n)
cchar_t cch;
for (i = 0; i < n; i++)
{
- setcchar (&cch, (i < wide_len ? &wide_str[i] : &padding),
- A_NORMAL, 0, NULL);
+ if (setcchar (&cch, (i < wide_len ? &wide_str[i] : &padding),
+ A_NORMAL, 0, NULL) == ERR)
+ setcchar (&cch, &error, A_NORMAL, 0, NULL);
add_wch (&cch);
}