wmtime: Fix "ordered comparison of pointer with integer zero" warning.
Also take the opportunity to add an error message when iconv_open fails.
This commit is contained in:
parent
79d7c047ce
commit
fd199f0612
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue