summary refs log tree commit diff
path: root/iconvdata/8bit-generic.c
diff options
context:
space:
mode:
Diffstat (limited to 'iconvdata/8bit-generic.c')
-rw-r--r--iconvdata/8bit-generic.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/iconvdata/8bit-generic.c b/iconvdata/8bit-generic.c
index 52cd540fb7..19194ad068 100644
--- a/iconvdata/8bit-generic.c
+++ b/iconvdata/8bit-generic.c
@@ -97,7 +97,7 @@ gconv (struct gconv_step *step, struct gconv_step_data *data,
 	      while (cnt < inchars
 		     && (outwchars + sizeof (wchar_t) <= data->outbufsize))
 		{
-		  wchar_t ch = to_ucs4[(unsigned int) inbuf[cnt]];
+		  wchar_t ch = to_ucs4[((unsigned char *) inbuf)[cnt]];
 
 		  if (ch == L'\0' && inbuf[cnt] != '\0')
 		    {
@@ -112,6 +112,7 @@ gconv (struct gconv_step *step, struct gconv_step_data *data,
 		  ++cnt;
 		}
 	      *inbufsize -= cnt;
+	      inbuf += cnt;
 	      data->outbufavail = outwchars;
 	    }
 	  else
@@ -136,6 +137,7 @@ gconv (struct gconv_step *step, struct gconv_step_data *data,
 		  cnt += sizeof (wchar_t);
 		}
 	      *inbufsize -= cnt;
+	      inbuf += cnt;
 	      data->outbufavail = outchars;
 
 	      if (outchars < data->outbufsize)