From: Ulrich Drepper Date: Wed, 12 Aug 1998 12:30:55 +0000 (+0000) Subject: (putspent): Avoid writting (none) in the passwd file. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=911bcdc43602dad9bcca2b6156b8ec1fd519ce36;p=thirdparty%2Fglibc.git (putspent): Avoid writting (none) in the passwd file. --- diff --git a/shadow/putspent.c b/shadow/putspent.c index 0e8649bc2c2..0354da3ba42 100644 --- a/shadow/putspent.c +++ b/shadow/putspent.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1996, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1996, 1997, 1998 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -19,6 +19,7 @@ #include #include +#define _S(x) x ? x : "" /* Write an entry to the given stream. This must know the format of the password file. */ @@ -27,7 +28,7 @@ putspent (const struct spwd *p, FILE *stream) { int errors = 0; - if (fprintf (stream, "%s:%s:", p->sp_namp, p->sp_pwdp) < 0) + if (fprintf (stream, "%s:%s:", p->sp_namp, _S(p->sp_pwdp)) < 0) ++errors; if ((p->sp_lstchg != (long int) -1