about summary refs log tree commit diff
path: root/string/strerror_l.c
diff options
context:
space:
mode:
Diffstat (limited to 'string/strerror_l.c')
-rw-r--r--string/strerror_l.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/string/strerror_l.c b/string/strerror_l.c
index c8c3d4a6ef..309f42e66b 100644
--- a/string/strerror_l.c
+++ b/string/strerror_l.c
@@ -40,10 +40,8 @@ translate (const char *str, locale_t loc)
 char *
 strerror_l (int errnum, locale_t loc)
 {
-
-
-  if (__builtin_expect (errnum < 0 || errnum >= _sys_nerr_internal
-			|| _sys_errlist_internal[errnum] == NULL, 0))
+  char *err = (char *) __get_errlist (errnum);
+  if (__glibc_unlikely (err == NULL))
     {
       free (last_value);
       if (__asprintf (&last_value, "%s%d",
@@ -53,7 +51,7 @@ strerror_l (int errnum, locale_t loc)
       return last_value;
     }
 
-  return (char *) translate (_sys_errlist_internal[errnum], loc);
+  return (char *) translate (err, loc);
 }
 
 void