aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-02-11 20:12:40 +0000
committerUlrich Drepper <drepper@redhat.com>2000-02-11 20:12:40 +0000
commit763125d1c74fe228a04cee4f76bf43f846065d4e (patch)
treeed3831eea9fdbd3da9a3d33055cb438c3a54d62a
parent586599b5005e6dbe608dd6885b0b282472494405 (diff)
downloadglibc-763125d1c74fe228a04cee4f76bf43f846065d4e.zip
glibc-763125d1c74fe228a04cee4f76bf43f846065d4e.tar.gz
glibc-763125d1c74fe228a04cee4f76bf43f846065d4e.tar.bz2
Update.
2000-02-11 Ulrich Drepper <drepper@redhat.com> * locale/nl_langinfo.c: Correct return value in error case. Don't set errno (PR libc/1582).
-rw-r--r--ChangeLog5
-rw-r--r--locale/nl_langinfo.c16
2 files changed, 10 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 6a5520f..94680b6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2000-02-11 Ulrich Drepper <drepper@redhat.com>
+
+ * locale/nl_langinfo.c: Correct return value in error case. Don't
+ set errno (PR libc/1582).
+
2000-02-02 Andreas Schwab <schwab@suse.de>
* malloc/Makefile (distribute): Add memprof.h.
diff --git a/locale/nl_langinfo.c b/locale/nl_langinfo.c
index 4c8e628..34772d3 100644
--- a/locale/nl_langinfo.c
+++ b/locale/nl_langinfo.c
@@ -1,5 +1,5 @@
/* User interface for extracting locale-dependent parameters.
- Copyright (C) 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 1997, 1999, 2000 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
@@ -34,20 +34,14 @@ nl_langinfo (item)
const struct locale_data *data;
if (category < 0 || category >= LC_ALL)
- {
- /* Bogus category: bogus item. */
- __set_errno (EINVAL);
- return NULL;
- }
+ /* Bogus category: bogus item. */
+ return "";
data = *_nl_current[category];
if (index >= data->nstrings)
- {
- /* Bogus index for this category: bogus item. */
- __set_errno (EINVAL);
- return NULL;
- }
+ /* Bogus index for this category: bogus item. */
+ return "";
/* Return the string for the specified item. */
return (char *) data->values[index].string;