From: Ulrich Drepper Date: Wed, 24 Apr 2002 20:25:33 +0000 (+0000) Subject: (MAX_NEEDED_FROM): Set to 4. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d87889e25895022baf7093595d01d516e322606;p=thirdparty%2Fglibc.git (MAX_NEEDED_FROM): Set to 4. (BODY for FROM_LOOP): Fix comparisons between inptr and inend. --- diff --git a/iconvdata/iso-2022-kr.c b/iconvdata/iso-2022-kr.c index 9846d920d90..e576e2a0839 100644 --- a/iconvdata/iso-2022-kr.c +++ b/iconvdata/iso-2022-kr.c @@ -1,5 +1,5 @@ /* Conversion module for ISO-2022-KR. - Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000-2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1998. @@ -40,7 +40,7 @@ #define FROM_LOOP from_iso2022kr_loop #define TO_LOOP to_iso2022kr_loop #define MIN_NEEDED_FROM 1 -#define MAX_NEEDED_FROM 3 +#define MAX_NEEDED_FROM 4 #define MIN_NEEDED_TO 4 #define MAX_NEEDED_TO 4 #define PREPARE_LOOP \ @@ -139,12 +139,11 @@ enum switching is done using the SI and SO bytes. But we have to \ recognize `Esc $ ) C' since this is a kind of flag for this \ encoding. We simply ignore it. */ \ - if (__builtin_expect (inptr + 1 > inend, 0) \ + if (__builtin_expect (inptr + 2 > inend, 0) \ || (inptr[1] == '$' \ - && (__builtin_expect (inptr + 2 > inend, 0) \ + && (__builtin_expect (inptr + 3 > inend, 0) \ || (inptr[2] == ')' \ - && __builtin_expect (inptr + 3 > inend, 0))))) \ - \ + && __builtin_expect (inptr + 4 > inend, 0))))) \ { \ result = __GCONV_INCOMPLETE_INPUT; \ break; \