summaryrefslogtreecommitdiff
path: root/net/ysm/files/patch-iconv
blob: 68f9deb982000208011c3645d9264f4a2c221e2f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--- YSM_ToolBox.c.orig	Fri Apr 12 11:07:38 2002
+++ YSM_ToolBox.c	Tue May 28 11:19:33 2002
@@ -45,6 +45,7 @@
 #include "YSM.h"
 /* International Languages Charset Convertion! */
 #include "YSM_Iconv.h"
+#include <iconv.h>
 
 
 static struct timeval tv;
@@ -428,9 +429,12 @@
        bytes_in  = strlen(buf_from) + 1;
        bytes_out = maxlen - 1;
        conv_d    = iconv_open(charset_to, charset_from);
-       bytes_res = iconv(conv_d, &inptr, &bytes_in, &outptr, &bytes_out);
+       if ( conv_d == (iconv_t)( -1)) { perror("iconv_open:"); return -1; }
+       else {
+       bytes_res = iconv(conv_d, (const char **)&inptr, &bytes_in, &outptr, &bytes_out);
        iconv_close(conv_d);
        return 0;
+       }
 }
 
 #endif