From fd199f0612e66ca50c86ff74acc080a0a7f2ec1e Mon Sep 17 00:00:00 2001
From: Doug Torrance <dtorrance@monmouthcollege.edu>
Date: Mon, 25 May 2015 17:21:30 -0500
Subject: [PATCH] wmtime: Fix "ordered comparison of pointer with integer zero"
 warning.

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);