gwlib/charset patch

"Nikos Balkanas" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <004501c996c8$e60913f0$02b2a8c0@tardis>
Hi,

Just a simple patch to get rid of that pesky iconv compiler warning. Couldn't stand it any more :-)

Enjoy,
Nikos
charset.diff (application/octet-stream, 1011 B)
Index: gwlib/charset.c
===================================================================
RCS file: /home/cvs/gateway/gwlib/charset.c,v
retrieving revision 1.29
diff -a -u -r1.29 charset.c
--- gwlib/charset.c	12 Jan 2009 16:46:53 -0000	1.29
+++ gwlib/charset.c	24 Feb 2009 21:39:11 -0000
@@ -612,7 +612,7 @@
     outbytes = sizeof(char) * octstr_len(string) * 4;
     pointer = to_buf = gw_malloc(outbytes + 1);
     memset(to_buf, 0, outbytes + 1);
-    ret = iconv(cd, (char**)&from_buf, &inbytes, &pointer, &outbytes);
+    ret = iconv(cd, (const char**)&from_buf, &inbytes, &pointer, &outbytes);
     iconv_close(cd);
     if (ret != -1) {
         /* conversion succeeded */
@@ -627,7 +627,7 @@
     }
 
     if (errno == EILSEQ) {
-        debug("charset_convert", 0, "Found an invalid multibyte sequence at position <%d>",
+        debug("charset_convert", 0, "Found an invalid multibyte sequence at position <%ld>",
               from_buf - octstr_get_cstr(string));     
     }
     gw_free(to_buf);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.