Minor bug fixes.
authordrepper <drepper>
Mon, 1 Dec 1997 16:54:14 +0000 (16:54 +0000)
committerdrepper <drepper>
Mon, 1 Dec 1997 16:54:14 +0000 (16:54 +0000)
iconvdata/iso6937.c
iconvdata/iso8859-1.c

index dc6da3b..b79a9aa 100644 (file)
@@ -498,6 +498,10 @@ gconv (struct gconv_step *step, struct gconv_step_data *data,
                        ch = L'\0';
                      else
                        ch = to_ucs4_comb[inchar - 0xc1][inchar2 - 0x20];
+
+                     if (ch == L'\0')
+                       /* Undo the increment for illegal characters.  */
+                       --cnt;
                    }
                  else
                    ch = to_ucs4[inchar];
index 94128fe..e7c120f 100644 (file)
@@ -142,7 +142,8 @@ gconv (struct gconv_step *step, struct gconv_step_data *data,
              while (inwchars >= cnt + sizeof (wchar_t)
                     && outchars < data->outbufsize)
                {
-                 if (*((wchar_t *) (inbuf + cnt)) <= L'\377')
+                 if (*((wchar_t *) (inbuf + cnt)) >= L'\0'
+                     && *((wchar_t *) (inbuf + cnt)) <= L'\377')
                    outbuf[outchars] = *((wchar_t *) (inbuf + cnt));
                  else
                    /* Here is where the transliteration would enter the