diff options
author | guido <guido@FreeBSD.org> | 1998-02-16 19:08:18 +0000 |
---|---|---|
committer | guido <guido@FreeBSD.org> | 1998-02-16 19:08:18 +0000 |
commit | 977c976366588ba7b89384d4c3c0d1260ca46ac7 (patch) | |
tree | 6ca7d28a7b87e718a876b9c6ee851204b3dce2d1 /usr.sbin/pwd_mkdb/pwd_mkdb.c | |
parent | 7836fb80f5b1a2c27eeca9390f1b976a6886b12d (diff) | |
download | FreeBSD-src-977c976366588ba7b89384d4c3c0d1260ca46ac7.zip FreeBSD-src-977c976366588ba7b89384d4c3c0d1260ca46ac7.tar.gz |
Apparently, if fprintf() fails, it can return any negative value
Pointed out by: Bruce
Diffstat (limited to 'usr.sbin/pwd_mkdb/pwd_mkdb.c')
-rw-r--r-- | usr.sbin/pwd_mkdb/pwd_mkdb.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/pwd_mkdb/pwd_mkdb.c b/usr.sbin/pwd_mkdb/pwd_mkdb.c index 61217eb..a6f0a43 100644 --- a/usr.sbin/pwd_mkdb/pwd_mkdb.c +++ b/usr.sbin/pwd_mkdb/pwd_mkdb.c @@ -42,7 +42,7 @@ static const char copyright[] = static char sccsid[] = "@(#)pwd_mkdb.c 8.5 (Berkeley) 4/20/94"; #endif static const char rcsid[] = - "$Id: pwd_mkdb.c,v 1.21 1998/01/10 17:27:28 wosch Exp $"; + "$Id: pwd_mkdb.c,v 1.22 1998/02/15 22:31:40 guido Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -384,7 +384,7 @@ main(argc, argv) } /* Create original format password file entry */ if (Cflag && makeold) /* copy comments */ - if (fprintf(oldfp, "%s\n", line) == EOF) + if (fprintf(oldfp, "%s\n", line) < 0) error("write old"); else if (makeold) { char uidstr[20]; @@ -396,7 +396,7 @@ main(argc, argv) if (fprintf(oldfp, "%s:*:%s:%s:%s:%s:%s\n", pwd.pw_name, pwd.pw_fields & _PWF_UID ? uidstr : "", pwd.pw_fields & _PWF_GID ? gidstr : "", - pwd.pw_gecos, pwd.pw_dir, pwd.pw_shell) == EOF) + pwd.pw_gecos, pwd.pw_dir, pwd.pw_shell) < 0) error("write old"); } } |