From cf970a32156e60e8842c5e9e82a3cb147dacaf64 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 23 Aug 2000 05:52:43 +0000 Subject: Update. * iconvdata/sjis.c: In conversion from UCS4, correct test for enough room in target buffer. Patch by KUSANO Takayuki [PR libc/1865]. * iconvdata/bug-iconv1.c: New file. * iconvdata/Makefile (tests): Add bug-iconv1. --- iconvdata/sjis.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'iconvdata/sjis.c') diff --git a/iconvdata/sjis.c b/iconvdata/sjis.c index 8d907b8..244cec6 100644 --- a/iconvdata/sjis.c +++ b/iconvdata/sjis.c @@ -4484,18 +4484,19 @@ static const char from_ucs4_extra[0x100][2] = } \ else \ { \ - *outptr++ = cp[0]; \ + *outptr = cp[0]; \ /* Now test for a possible second byte and write this if possible. */\ if (cp[1] != '\0') \ { \ - if (__builtin_expect (outptr >= outend, 0)) \ + if (__builtin_expect (outptr + 1 >= outend, 0)) \ { \ /* The result does not fit into the buffer. */ \ result = __GCONV_FULL_OUTPUT; \ break; \ } \ - *outptr++ = cp[1]; \ + *++outptr = cp[1]; \ } \ + ++outptr; \ } \ \ inptr += 4; \ -- cgit v1.1