about summary refs log tree commit diff
path: root/iconvdata/ibm939.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2005-05-21 18:40:10 +0000
committerUlrich Drepper <drepper@redhat.com>2005-05-21 18:40:10 +0000
commit363dd976272ecf5975c1996c829e614d452a8f8d (patch)
tree583056a34cffab4ce27ecdb2c64325749eabb6fc /iconvdata/ibm939.c
parent572215377f0220adef77eefccedc731cd4fb523a (diff)
downloadglibc-363dd976272ecf5975c1996c829e614d452a8f8d.tar.gz
glibc-363dd976272ecf5975c1996c829e614d452a8f8d.tar.xz
glibc-363dd976272ecf5975c1996c829e614d452a8f8d.zip
[BZ #955]
2005-05-19  Richard Henderson  <rth@redhat.com>
	* sysdeps/unix/clock_gettime.c (clock_gettime): Fix typo around
	CLOCK_REALTIME.

	* sysdeps/ia64/bits/atomic.h (__arch_compare_and_exchange_bool_32_acq,
	__arch_compare_and_exchange_bool_64_acq,
	__arch_compare_and_exchange_val_32_acq,
	__arch_compare_and_exchange_val_64_acq, atomic_exchange_and_add):
	Use __sync builtin without _si or _di suffix.

2005-05-19  Jakub Jelinek  <jakub@redhat.com>

	[BZ #955]
	* iconvdata/ibm939.c (BODY): Avoid segfaults with input characters
	<UFFFF> and above.

2005-05-17  Andreas Schwab  <schwab@suse.de>

	* sysdeps/unix/sysv/linux/clock_getcpuclockid.c
	(clock_getcpuclockid): Always return a defined value.
Diffstat (limited to 'iconvdata/ibm939.c')
-rw-r--r--iconvdata/ibm939.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/iconvdata/ibm939.c b/iconvdata/ibm939.c
index aae08ba3d1..50b083f492 100644
--- a/iconvdata/ibm939.c
+++ b/iconvdata/ibm939.c
@@ -1,5 +1,5 @@
 /* Conversion to and from IBM939.
-   Copyright (C) 2000-2002 Free Software Foundation, Inc.
+   Copyright (C) 2000-2002, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Masahide Washizawa <washi@yamato.ibm.co.jp>, 2000.
 
@@ -200,16 +200,14 @@ enum
     if (__builtin_expect (ch >= 0xffff, 0))				      \
       {									      \
 	UNICODE_TAG_HANDLER (ch, 4);					      \
-	rp1 = NULL;							      \
-	rp2 = NULL;							      \
+	goto ibm939_invalid_char;					      \
       }									      \
-    else								      \
-      while (ch > rp1->end)						      \
-	++rp1;								      \
+									      \
+    while (ch > rp1->end)						      \
+      ++rp1;								      \
 									      \
     /* Use the UCS4 table for single byte.  */				      \
-    if (__builtin_expect (rp1 == NULL, 0)				      \
-	|| __builtin_expect (ch < rp1->start, 0)			      \
+    if (__builtin_expect (ch < rp1->start, 0)				      \
 	|| (cp = __ucs4_to_ibm939sb[ch + rp1->idx],			      \
 	    __builtin_expect (cp[0], L'\1') == L'\0' && ch != '\0'))	      \
       {									      \
@@ -217,12 +215,12 @@ enum
 	while (ch > rp2->end)						      \
 	  ++rp2;							      \
 									      \
-	if (__builtin_expect (rp2 == NULL, 0)				      \
-	    || __builtin_expect (ch < rp2->start, 0)			      \
+	if (__builtin_expect (ch < rp2->start, 0)			      \
 	    || (cp = __ucs4_to_ibm939db[ch + rp2->idx],			      \
 		__builtin_expect (cp[0], L'\1')==L'\0' && ch != '\0'))	      \
 	  {								      \
 	    /* This is an illegal character.  */			      \
+	  ibm939_invalid_char:						      \
 	    STANDARD_TO_LOOP_ERR_HANDLER (4);				      \
 	  }								      \
 	else								      \