aboutsummaryrefslogtreecommitdiff
path: root/apps/passwd.c
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>2000-04-27 09:11:28 +0000
committerBodo Möller <bodo@openssl.org>2000-04-27 09:11:28 +0000
commit7fc840cc8505356446bdc640e557f19e4a743157 (patch)
tree5640a138f31ee40006718c32ec3a0fb497bf7448 /apps/passwd.c
parent4adcfa052f0fcae35a92b9c7e0248d9c6586a6ca (diff)
downloadopenssl-7fc840cc8505356446bdc640e557f19e4a743157.zip
openssl-7fc840cc8505356446bdc640e557f19e4a743157.tar.gz
openssl-7fc840cc8505356446bdc640e557f19e4a743157.tar.bz2
Stylistic changes: Don't use a macro for the malloc'ed length since it
is not constant.
Diffstat (limited to 'apps/passwd.c')
-rw-r--r--apps/passwd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/passwd.c b/apps/passwd.c
index 5a7c99a..4650ea5 100644
--- a/apps/passwd.c
+++ b/apps/passwd.c
@@ -63,6 +63,7 @@ int MAIN(int argc, char **argv)
int in_stdin = 0;
char *salt = NULL, *passwd = NULL, **passwds = NULL;
char *salt_malloc = NULL, *passwd_malloc = NULL;
+ size_t passwd_malloc_size = 0;
int pw_source_defined = 0;
BIO *in = NULL, *out = NULL;
int i, badopt, opt_done;
@@ -196,9 +197,10 @@ int MAIN(int argc, char **argv)
if (passwds == NULL)
{
/* no passwords on the command line */
-#define PASSWD_MALLOC_SIZE (pw_maxlen + 2)
+
+ passwd_malloc_size = pw_maxlen + 2;
/* longer than necessary so that we can warn about truncation */
- passwd = passwd_malloc = Malloc(PASSWD_MALLOC_SIZE);
+ passwd = passwd_malloc = Malloc(passwd_malloc_size);
if (passwd_malloc == NULL)
goto err;
}
@@ -210,7 +212,7 @@ int MAIN(int argc, char **argv)
passwds = passwds_static;
if (in == NULL)
- if (EVP_read_pw_string(passwd_malloc, PASSWD_MALLOC_SIZE, "Password: ", 0) != 0)
+ if (EVP_read_pw_string(passwd_malloc, passwd_malloc_size, "Password: ", 0) != 0)
goto err;
passwds[0] = passwd_malloc;
}