diff options
-rw-r--r-- | pw/pw_user.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pw/pw_user.c b/pw/pw_user.c index cf38e9c..76849ba 100644 --- a/pw/pw_user.c +++ b/pw/pw_user.c @@ -491,6 +491,7 @@ pw_pwcrypt(char *password) char salt[SALTSIZE + 1]; char *cryptpw; static char buf[256]; + size_t pwlen; /* * Calculate a salt value @@ -502,7 +503,8 @@ pw_pwcrypt(char *password) cryptpw = crypt(password, salt); if (cryptpw == NULL) errx(EX_CONFIG, "crypt(3) failure"); - assert(strlcpy(buf, cryptpw, sizeof(buf)) < sizeof(buf)); + pwlen = strlcpy(buf, cryptpw, sizeof(buf)); + assert(pwlen < sizeof(buf)); return (buf); } |