about summary refs log tree commit diff
path: root/nis/nis_creategroup.c
diff options
context:
space:
mode:
Diffstat (limited to 'nis/nis_creategroup.c')
-rw-r--r--nis/nis_creategroup.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/nis/nis_creategroup.c b/nis/nis_creategroup.c
index 8333e09c89..cd882ca01d 100644
--- a/nis/nis_creategroup.c
+++ b/nis/nis_creategroup.c
@@ -23,11 +23,12 @@
 nis_error
 nis_creategroup (const_nis_name group, u_long flags)
 {
-  if (group != NULL && strlen (group) > 0)
+  if (group != NULL && group[0] != '\0')
     {
-      char buf[strlen (group) + 50];
-      char leafbuf[strlen (group) + 2];
-      char domainbuf[strlen (group) + 2];
+      size_t grouplen = strlen (group);
+      char buf[grouplen + 50];
+      char leafbuf[grouplen + 2];
+      char domainbuf[grouplen + 2];
       nis_error status;
       nis_result *res;
       char *cp, *cp2;
@@ -36,7 +37,7 @@ nis_creategroup (const_nis_name group, u_long flags)
       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);