diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-05-28 10:17:50 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-05-28 10:17:50 +0000 |
commit | 1a42fe2055ce7d20299b3e4a3a66102bb15ce6c3 (patch) | |
tree | 6853729af9d17c6023b79d8e8420da3e01e406d3 /usr.bin | |
parent | 4c21dd03331eaa7b12d7bab3bea989fc33101262 (diff) |
permit any gecos field to be empty
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/chpass/edit.c | 13 |
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; |