aboutsummaryrefslogtreecommitdiff
path: root/nis
diff options
context:
space:
mode:
Diffstat (limited to 'nis')
-rw-r--r--nis/nss-nis.h4
-rw-r--r--nis/nss-nisplus.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/nis/nss-nis.h b/nis/nss-nis.h
index 8d5ff5619a..a6071963c6 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 436a2e6e20..1c034c0861 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 */