summary refs log tree commit diff
path: root/nss/nsswitch.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2006-05-11 14:01:43 +0000
committerJakub Jelinek <jakub@redhat.com>2006-05-11 14:01:43 +0000
commit3ec0d26c76d6905501034692d05bddbabae64e76 (patch)
tree191efcdfd934a0369cdef723fe4f650fe2f3dcfc /nss/nsswitch.c
parent262cf6b3df91d5bb7cbdcae2390333b21e8008d5 (diff)
downloadglibc-3ec0d26c76d6905501034692d05bddbabae64e76.tar.gz
glibc-3ec0d26c76d6905501034692d05bddbabae64e76.tar.xz
glibc-3ec0d26c76d6905501034692d05bddbabae64e76.zip
Updated to fedora-glibc-20060511T1325 cvs/fedora-glibc-2_4_90-7
Diffstat (limited to 'nss/nsswitch.c')
-rw-r--r--nss/nsswitch.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/nss/nsswitch.c b/nss/nsswitch.c
index 7e5e6e8164..21174dfbab 100644
--- a/nss/nsswitch.c
+++ b/nss/nsswitch.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005
+/* Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005, 2006
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -70,6 +70,7 @@ static const struct
 #include "databases.def"
 #undef DEFINE_DATABASE
 };
+#define ndatabases (sizeof (databases) / sizeof (databases[0]))
 
 
 __libc_lock_define_initialized (static, lock)
@@ -211,7 +212,7 @@ __nss_configure_lookup (const char *dbname, const char *service_line)
   service_user *new_db;
   size_t cnt;
 
-  for (cnt = 0; cnt < sizeof databases; ++cnt)
+  for (cnt = 0; cnt < ndatabases; ++cnt)
     {
       int cmp = strcmp (dbname, databases[cnt].name);
       if (cmp == 0)
@@ -223,7 +224,7 @@ __nss_configure_lookup (const char *dbname, const char *service_line)
 	}
     }
 
-  if (cnt == sizeof databases)
+  if (cnt == ndatabases)
     {
       __set_errno (EINVAL);
       return -1;