This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
bug in EUC/SHIFT-JISX0213 converters
- From: Bruno Haible <bruno at clisp dot org>
- To: libc-alpha at sources dot redhat dot com
- Date: Mon, 13 May 2002 15:17:10 +0200 (CEST)
- Subject: bug in EUC/SHIFT-JISX0213 converters
This fixes a bug in the EUC-JISX0213 and SHIFT_JISX0213 converters: in some
cases the input pointer would be advanced although the loop stops with
result __GCONV_FULL_OUTPUT.
2002-05-12 Bruno Haible <bruno@clisp.org>
* iconvdata/euc-jisx0213.c (BODY for FROM_LOOP): Don't advance inptr
when there is not enough room in the output buffer.
* iconvdata/shift_jisx0213.c (BODY for FROM_LOOP): Likewise.
--- glibc-20020425/iconvdata/euc-jisx0213.c.bak 2002-04-25 15:44:11.000000000 +0200
+++ glibc-20020425/iconvdata/euc-jisx0213.c 2002-05-11 19:09:32.000000000 +0200
@@ -195,8 +201,6 @@
break; \
} \
\
- inptr = endp; \
- \
if (ch < 0x80) \
{ \
/* It's a combining character. */ \
@@ -206,6 +210,7 @@
/* See whether we have room for two characters. */ \
if (outptr + 8 <= outend) \
{ \
+ inptr = endp; \
put32 (outptr, u1); \
outptr += 4; \
put32 (outptr, u2); \
@@ -218,6 +223,8 @@
break; \
} \
} \
+ \
+ inptr = endp; \
} \
} \
else \
--- glibc-20020425/iconvdata/shift_jisx0213.c.bak 2002-04-25 15:44:13.000000000 +0200
+++ glibc-20020425/iconvdata/shift_jisx0213.c 2002-05-11 19:09:30.000000000 +0200
@@ -185,8 +191,6 @@
break; \
} \
\
- inptr += 2; \
- \
if (ch < 0x80) \
{ \
/* It's a combining character. */ \
@@ -196,6 +200,7 @@
/* See whether we have room for two characters. */ \
if (outptr + 8 <= outend) \
{ \
+ inptr += 2; \
put32 (outptr, u1); \
outptr += 4; \
put32 (outptr, u2); \
@@ -208,6 +213,8 @@
break; \
} \
} \
+ \
+ inptr += 2; \
} \
else \
{ \