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:
Doug Torrance 2015-05-25 17:21:30 -05:00 committed by Carlos R. Mafra
parent 79d7c047ce
commit fd199f0612

View file

@ -189,8 +189,10 @@ void get_lang(void)
size_t insize, outsize; size_t insize, outsize;
icd = iconv_open("ASCII//TRANSLIT", nl_langinfo(CODESET)); icd = iconv_open("ASCII//TRANSLIT", nl_langinfo(CODESET));
if (icd < 0) if (icd == (iconv_t) -1) {
perror("wmtime: Error allocating charset conversion descriptor");
return; return;
}
for (i = 0; i < 7; i++) { for (i = 0; i < 7; i++) {
strncpy(langbuf, nl_langinfo(ABDAY_1 + i), 10); strncpy(langbuf, nl_langinfo(ABDAY_1 + i), 10);