Also take the opportunity to add an error message when iconv_open fails.
---
 wmtime/wmtime.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/wmtime/wmtime.c b/wmtime/wmtime.c
index 562907f..c925c68 100644
--- a/wmtime/wmtime.c
+++ b/wmtime/wmtime.c
@@ -189,8 +189,10 @@ void get_lang(void)
        size_t insize, outsize;
 
        icd = iconv_open("ASCII//TRANSLIT", nl_langinfo(CODESET));
-       if (icd < 0)
+       if (icd == (iconv_t) -1) {
+               perror("wmtime: Error allocating charset conversion 
descriptor");
                return;
+       }
 
        for (i = 0; i < 7; i++) {
                strncpy(langbuf, nl_langinfo(ABDAY_1 + i), 10);
-- 
2.1.4


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to