aboutsummaryrefslogtreecommitdiff
path: root/lib/libkiconv/xlat16_iconv.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libkiconv/xlat16_iconv.c')
-rw-r--r--lib/libkiconv/xlat16_iconv.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/libkiconv/xlat16_iconv.c b/lib/libkiconv/xlat16_iconv.c
index fee3c77a73af..3efb7795634f 100644
--- a/lib/libkiconv/xlat16_iconv.c
+++ b/lib/libkiconv/xlat16_iconv.c
@@ -62,7 +62,7 @@ static int chklocale(int, const char *);
typedef void *iconv_t;
static int my_iconv_init(void);
static iconv_t (*my_iconv_open)(const char *, const char *);
-static size_t (*my_iconv)(iconv_t, const char **, size_t *, char **, size_t *);
+static size_t (*my_iconv)(iconv_t, char **, size_t *, char **, size_t *);
static int (*my_iconv_close)(iconv_t);
#else
#include <iconv.h>
@@ -71,7 +71,7 @@ static int (*my_iconv_close)(iconv_t);
#define my_iconv iconv
#define my_iconv_close iconv_close
#endif
-static size_t my_iconv_char(iconv_t, const u_char **, size_t *, u_char **, size_t *);
+static size_t my_iconv_char(iconv_t, u_char **, size_t *, u_char **, size_t *);
int
kiconv_add_xlat16_cspair(const char *tocode, const char *fromcode, int flag)
@@ -221,8 +221,8 @@ kiconv_xlat16_open(const char *tocode, const char *fromcode, int lcase)
src[0] = (u_char)(c >> 8);
src[1] = (u_char)c;
- ret = my_iconv_char(cd, (const u_char **)&srcp,
- &inbytesleft, &dstp, &outbytesleft);
+ ret = my_iconv_char(cd, &srcp, &inbytesleft,
+ &dstp, &outbytesleft);
if (ret == -1) {
table[us] = 0;
continue;
@@ -338,11 +338,10 @@ my_iconv_init(void)
#endif
static size_t
-my_iconv_char(iconv_t cd, const u_char **ibuf, size_t * ilen, u_char **obuf,
+my_iconv_char(iconv_t cd, u_char **ibuf, size_t * ilen, u_char **obuf,
size_t * olen)
{
- const u_char *sp;
- u_char *dp, ilocal[3], olocal[3];
+ u_char *sp, *dp, ilocal[3], olocal[3];
u_char c1, c2;
int ret;
size_t ir, or;
@@ -352,7 +351,7 @@ my_iconv_char(iconv_t cd, const u_char **ibuf, size_t * ilen, u_char **obuf,
ir = *ilen;
bzero(*obuf, *olen);
- ret = my_iconv(cd, (const char **)&sp, ilen, (char **)&dp, olen);
+ ret = my_iconv(cd, (char **)&sp, ilen, (char **)&dp, olen);
c1 = (*obuf)[0];
c2 = (*obuf)[1];
@@ -375,7 +374,7 @@ my_iconv_char(iconv_t cd, const u_char **ibuf, size_t * ilen, u_char **obuf,
sp = ilocal;
dp = olocal;
- if ((my_iconv(cd,(const char **)&sp, &ir, (char **)&dp, &or)) != -1) {
+ if ((my_iconv(cd,(char **)&sp, &ir, (char **)&dp, &or)) != -1) {
if (olocal[0] != c1)
return (ret);
@@ -429,7 +428,7 @@ my_iconv_char(iconv_t cd, const u_char **ibuf, size_t * ilen, u_char **obuf,
sp = ilocal + 1;
dp = olocal;
- if ((my_iconv(cd,(const char **)&sp, &ir, (char **)&dp, &or)) != -1) {
+ if ((my_iconv(cd,(char **)&sp, &ir, (char **)&dp, &or)) != -1) {
if (olocal[0] == c2)
/*
* inbuf is a single byte char