summaryrefslogtreecommitdiffstats
path: root/pw/pwupd.c
diff options
context:
space:
mode:
Diffstat (limited to 'pw/pwupd.c')
-rw-r--r--pw/pwupd.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/pw/pwupd.c b/pw/pwupd.c
index fef3662..ec29b9e 100644
--- a/pw/pwupd.c
+++ b/pw/pwupd.c
@@ -166,6 +166,8 @@ pw_update(struct passwd * pwd, char const * user, int mode)
else
fmtpwentry(pwbuf, pwd, PWF_PASSWD);
+ if (l == -1)
+ l = 0;
rc = fileupdate(getpwpath(_PASSWD), 0644, pwbuf, pfx, l, mode);
if (rc == 0) {