From: Ulrich Drepper Date: Wed, 8 Dec 1999 04:57:38 +0000 (+0000) Subject: (from_ansi_x3_110): Don't increment pointers if character is illegal. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8b3fb1ee01524cb0c617086febff316b37c98e9;p=thirdparty%2Fglibc.git (from_ansi_x3_110): Don't increment pointers if character is illegal. --- diff --git a/iconvdata/ansi_x3.110.c b/iconvdata/ansi_x3.110.c index c754ce05f6d..eb5e2eaeb0d 100644 --- a/iconvdata/ansi_x3.110.c +++ b/iconvdata/ansi_x3.110.c @@ -1,5 +1,5 @@ /* Generic conversion to and from ANSI_X3.110-1983. - Copyright (C) 1998 Free Software Foundation, Inc. + Copyright (C) 1998, 1999 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1998. @@ -399,6 +399,7 @@ static const char from_ucs4[][2] = #define BODY \ { \ uint32_t ch = *inptr; \ + int incr; \ \ if (ch >= 0xc1 && ch <= 0xcf) \ { \ @@ -424,12 +425,12 @@ static const char from_ucs4[][2] = \ ch = to_ucs4_comb[ch - 0xc1][ch2 - 0x20]; \ \ - inptr += 2; \ + incr = 2; \ } \ else \ { \ ch = to_ucs4[ch]; \ - ++inptr; \ + incr = 1; \ } \ \ if (ch == 0 && *inptr != '\0') \ @@ -439,6 +440,7 @@ static const char from_ucs4[][2] = break; \ } \ \ + inptr += incr; \ *((uint32_t *) outptr)++ = ch; \ } #include