From 7c2034adce8d3f23ba774a83e02f0891a893f511 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 28 Apr 2001 02:20:30 +0000 Subject: [PATCH] Update. 2001-04-27 Ulrich Drepper * nis/nss-nis.h: Correct test for invalid error number. * nis/nss-nisplus.h: Likewise. --- ChangeLog | 5 +++++ nis/nss-nis.h | 4 ++-- nis/nss-nisplus.h | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 69067db..b912339 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-04-27 Ulrich Drepper + + * nis/nss-nis.h: Correct test for invalid error number. + * nis/nss-nisplus.h: Likewise. + 2001-04-26 Ulrich Drepper * sysdeps/unix/sysv/linux/ia64/syscalls.list: Add getunwind. diff --git a/nis/nss-nis.h b/nis/nss-nis.h index 8d5ff56..a607196 100644 --- a/nis/nss-nis.h +++ b/nis/nss-nis.h @@ -31,9 +31,9 @@ extern const unsigned int __yperr2nss_count; static inline enum nss_status yperr2nss (int errval) { - if ((unsigned int) errval > __yperr2nss_count) + if ((unsigned int) errval >= __yperr2nss_count) return NSS_STATUS_UNAVAIL; - return __yperr2nss_tab[errval]; + return __yperr2nss_tab[(unsigned int) errval]; } #endif /* nis/nss-nis.h */ diff --git a/nis/nss-nisplus.h b/nis/nss-nisplus.h index 436a2e6..1c034c0 100644 --- a/nis/nss-nisplus.h +++ b/nis/nss-nisplus.h @@ -32,9 +32,9 @@ extern const unsigned int __niserr2nss_count; static inline enum nss_status niserr2nss (int errval) { - if ((unsigned int) errval > __niserr2nss_count) + if ((unsigned int) errval >= __niserr2nss_count) return NSS_STATUS_UNAVAIL; - return __niserr2nss_tab[errval]; + return __niserr2nss_tab[(unsigned int) errval]; } #endif /* nis/nss-nisplus.h */ -- 2.7.4