aboutsummaryrefslogtreecommitdiff
path: root/nis/nis_print_group_entry.c
diff options
context:
space:
mode:
Diffstat (limited to 'nis/nis_print_group_entry.c')
-rw-r--r--nis/nis_print_group_entry.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/nis/nis_print_group_entry.c b/nis/nis_print_group_entry.c
index fbc9ad11ba..d5cdda038c 100644
--- a/nis/nis_print_group_entry.c
+++ b/nis/nis_print_group_entry.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 1997 Free Software Foundation, Inc.
+/* Copyright (c) 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997.
@@ -23,11 +23,12 @@
void
nis_print_group_entry (const_nis_name group)
{
- if (group != NULL && strlen (group) > 0)
+ if (group != NULL && group[0] != '\0')
{
- char buf[strlen (group) + 50];
- char leafbuf[strlen (group) + 3];
- char domainbuf[strlen (group) + 3];
+ size_t grouplen = strlen (group);
+ char buf[grouplen + 50];
+ char leafbuf[grouplen + 3];
+ char domainbuf[grouplen + 3];
unsigned long mem_exp_cnt = 0, mem_imp_cnt = 0, mem_rec_cnt = 0;
unsigned long nomem_exp_cnt = 0, nomem_imp_cnt = 0, nomem_rec_cnt = 0;
char **mem_exp, **mem_imp, **mem_rec;
@@ -39,7 +40,7 @@ nis_print_group_entry (const_nis_name group)
cp = stpcpy (buf, nis_leaf_of_r (group, leafbuf, sizeof (leafbuf) - 1));
cp = stpcpy (cp, ".groups_dir");
cp2 = nis_domain_of_r (group, domainbuf, sizeof (domainbuf) - 1);
- if (cp2 != NULL && strlen (cp2) > 0)
+ if (cp2 != NULL && cp2[0] != '\0')
{
*cp++ = '.';
stpcpy (cp, cp2);