summaryrefslogtreecommitdiff
path: root/usr.bin/chpass
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1998-05-28 10:17:50 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1998-05-28 10:17:50 +0000
commit1a42fe2055ce7d20299b3e4a3a66102bb15ce6c3 (patch)
tree6853729af9d17c6023b79d8e8420da3e01e406d3 /usr.bin/chpass
parent4c21dd03331eaa7b12d7bab3bea989fc33101262 (diff)
permit any gecos field to be empty
Diffstat (limited to 'usr.bin/chpass')
-rw-r--r--usr.bin/chpass/edit.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/usr.bin/chpass/edit.c b/usr.bin/chpass/edit.c
index 9f0d3736b96..ab9d3dfc1ce 100644
--- a/usr.bin/chpass/edit.c
+++ b/usr.bin/chpass/edit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: edit.c,v 1.13 1998/03/30 06:59:31 deraadt Exp $ */
+/* $OpenBSD: edit.c,v 1.14 1998/05/28 10:17:49 deraadt Exp $ */
/* $NetBSD: edit.c,v 1.6 1996/05/15 21:50:45 jtc Exp $ */
/*-
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)edit.c 8.3 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$OpenBSD: edit.c,v 1.13 1998/03/30 06:59:31 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: edit.c,v 1.14 1998/05/28 10:17:49 deraadt Exp $";
#endif
#endif /* not lint */
@@ -203,6 +203,15 @@ bad: (void)fclose(fp);
}
(void)fclose(fp);
+ if (list[E_NAME].save == NULL)
+ list[E_NAME].save = "";
+ if (list[E_BPHONE].save == NULL)
+ list[E_BPHONE].save = "";
+ if (list[E_HPHONE].save == NULL)
+ list[E_HPHONE].save = "";
+ if (list[E_LOCATE].save == NULL)
+ list[E_LOCATE].save = "";
+
/* Build the gecos field. */
len = strlen(list[E_NAME].save) + strlen(list[E_BPHONE].save) +
strlen(list[E_HPHONE].save) + strlen(list[E_LOCATE].save) + 4;