summaryrefslogtreecommitdiff
path: root/apps/enc.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2017-12-07 13:39:34 -0500
committerRich Salz <rsalz@openssl.org>2017-12-07 19:11:49 -0500
commitcbe2964821bb063f61ed2544cfce196ec1c0d62b (patch)
tree098cdc33d8174fffae52bd8885e384ef86570c25 /apps/enc.c
parente7a206694451be19432d079691610994473f53b7 (diff)
downloadopenssl-new-cbe2964821bb063f61ed2544cfce196ec1c0d62b.tar.gz
Consistent formatting for sizeof(foo)
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4872)
Diffstat (limited to 'apps/enc.c')
-rw-r--r--apps/enc.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/apps/enc.c b/apps/enc.c
index 14b029b33f..af882598cc 100644
--- a/apps/enc.c
+++ b/apps/enc.c
@@ -98,7 +98,7 @@ int enc_main(int argc, char **argv)
char *hkey = NULL, *hiv = NULL, *hsalt = NULL, *p;
char *infile = NULL, *outfile = NULL, *prog;
char *str = NULL, *passarg = NULL, *pass = NULL, *strbuf = NULL;
- char mbuf[sizeof magic - 1];
+ char mbuf[sizeof(magic) - 1];
OPTION_CHOICE o;
int bsize = BSIZE, verbose = 0, debug = 0, olb64 = 0, nosalt = 0;
int enc = 1, printkey = 0, i, k;
@@ -220,7 +220,7 @@ int enc_main(int argc, char **argv)
in = bio_open_default(opt_arg(), 'r', FORMAT_TEXT);
if (in == NULL)
goto opthelp;
- i = BIO_gets(in, buf, sizeof buf);
+ i = BIO_gets(in, buf, sizeof(buf));
BIO_free(in);
in = NULL;
if (i <= 0) {
@@ -409,11 +409,11 @@ int enc_main(int argc, char **argv)
} else {
if (enc) {
if (hsalt) {
- if (!set_hex(hsalt, salt, sizeof salt)) {
+ if (!set_hex(hsalt, salt, sizeof(salt))) {
BIO_printf(bio_err, "invalid hex salt value\n");
goto end;
}
- } else if (RAND_bytes(salt, sizeof salt) <= 0) {
+ } else if (RAND_bytes(salt, sizeof(salt)) <= 0) {
goto end;
}
/*
@@ -421,20 +421,20 @@ int enc_main(int argc, char **argv)
*/
if ((printkey != 2)
&& (BIO_write(wbio, magic,
- sizeof magic - 1) != sizeof magic - 1
+ sizeof(magic) - 1) != sizeof(magic) - 1
|| BIO_write(wbio,
(char *)salt,
- sizeof salt) != sizeof salt)) {
+ sizeof(salt)) != sizeof(salt))) {
BIO_printf(bio_err, "error writing output file\n");
goto end;
}
- } else if (BIO_read(rbio, mbuf, sizeof mbuf) != sizeof mbuf
+ } else if (BIO_read(rbio, mbuf, sizeof(mbuf)) != sizeof(mbuf)
|| BIO_read(rbio,
(unsigned char *)salt,
- sizeof salt) != sizeof salt) {
+ sizeof(salt)) != sizeof(salt)) {
BIO_printf(bio_err, "error reading input file\n");
goto end;
- } else if (memcmp(mbuf, magic, sizeof magic - 1)) {
+ } else if (memcmp(mbuf, magic, sizeof(magic) - 1)) {
BIO_printf(bio_err, "bad magic number\n");
goto end;
}