about summary refs log tree commit diff
path: root/string/_strerror.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2006-06-22 23:59:32 +0000
committerUlrich Drepper <drepper@redhat.com>2006-06-22 23:59:32 +0000
commit4259230fd19559ba398ff40c117fa43089003b51 (patch)
tree4307f68fc12a00733e92f878ff50bc40480a6692 /string/_strerror.c
parentf9b7a98b18c8c1dc20744e86352f0447a2cf2e77 (diff)
downloadglibc-4259230fd19559ba398ff40c117fa43089003b51.tar.gz
glibc-4259230fd19559ba398ff40c117fa43089003b51.tar.xz
glibc-4259230fd19559ba398ff40c117fa43089003b51.zip
* intl/dcigettext.c (DCIGETTEXT): If _nl_find_msg returns -1 don't
	look further, return original strings.
	(_nl_find_msg): Do not return found translation if the conversion
	failed.  Either signal the string is unusable or that something went
	wrong and the original should be used.

2006-06-21  Ulrich Drepper  <drepper@redhat.com>

	* string/_strerror.c (__strerror_r): Add __builtin_expect.
Diffstat (limited to 'string/_strerror.c')
-rw-r--r--string/_strerror.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/string/_strerror.c b/string/_strerror.c
index f6f16ff2af..cb5d9e3609 100644
--- a/string/_strerror.c
+++ b/string/_strerror.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991,93,95,96,97,98,2000,2002 Free Software Foundation, Inc.
+/* Copyright (C) 1991,93,95,96,97,98,2000,2002,2006
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -35,8 +36,8 @@
 char *
 __strerror_r (int errnum, char *buf, size_t buflen)
 {
-  if (errnum < 0 || errnum >= _sys_nerr_internal
-      || _sys_errlist_internal[errnum] == NULL)
+  if (__builtin_expect (errnum < 0 || errnum >= _sys_nerr_internal
+			|| _sys_errlist_internal[errnum] == NULL, 0))
     {
       /* Buffer we use to print the number in.  For a maximum size for
 	 `int' of 8 bytes we never need more than 20 digits.  */