From: Ulrich Drepper Date: Fri, 30 Jan 1998 17:14:42 +0000 (+0000) Subject: (_nss_db_getaliasent_r): Don't include terminating null in key size. X-Git-Tag: cvs/before-sparc-2_0_x-branch~250 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0602dc71bc4c40287490f7650dc751e247277474;p=thirdparty%2Fglibc.git (_nss_db_getaliasent_r): Don't include terminating null in key size. --- diff --git a/nss/nss_db/db-alias.c b/nss/nss_db/db-alias.c index 349ce9cfb22..fa63ca9ad3d 100644 --- a/nss/nss_db/db-alias.c +++ b/nss/nss_db/db-alias.c @@ -1,5 +1,5 @@ /* Mail alias file parser in nss_db module. - Copyright (C) 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. @@ -220,13 +220,13 @@ lookup (const DBT *key, struct aliasent *result, char *buffer, enum nss_status _nss_db_getaliasent_r (struct aliasent *result, char *buffer, size_t buflen) { - /* Return next entry in host file. */ + /* Return next entry in alias file. */ enum nss_status status; char buf[20]; DBT key; __libc_lock_lock (lock); - key.size = 1 + snprintf (key.data = buf, sizeof buf, "0%u", entidx++); + key.size = snprintf (key.data = buf, sizeof buf, "0%u", entidx++); status = lookup (&key, result, buffer, buflen); __libc_lock_unlock (lock);