diff options
author | Rich Salz <rsalz@akamai.com> | 2015-05-04 18:00:15 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-05-05 22:18:59 -0400 |
commit | 16f8d4ebf0fd4847fa83d9c61f4150273cb4f533 (patch) | |
tree | 3c30094cad38433c24008c30efe3d93cf38d8ae9 /test/rc4test.c | |
parent | 12048657a91b12e499d03ec9ff406b42aba67366 (diff) | |
download | openssl-16f8d4ebf0fd4847fa83d9c61f4150273cb4f533.tar.gz |
memset, memcpy, sizeof consistency fixes
Just as with the OPENSSL_malloc calls, consistently use sizeof(*ptr)
for memset and memcpy. Remove needless casts for those functions.
For memset, replace alternative forms of zero with 0.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'test/rc4test.c')
-rw-r--r-- | test/rc4test.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/rc4test.c b/test/rc4test.c index a1f96e4cb8..a8e5a8e31b 100644 --- a/test/rc4test.c +++ b/test/rc4test.c @@ -129,7 +129,7 @@ int main(int argc, char *argv[]) for (i = 0; i < 6; i++) { RC4_set_key(&key, keys[i][0], &(keys[i][1])); - memset(obuf, 0x00, sizeof(obuf)); + memset(obuf, 0, sizeof(obuf)); RC4(&key, data_len[i], &(data[i][0]), obuf); if (memcmp(obuf, output[i], data_len[i] + 1) != 0) { printf("error calculating RC4\n"); @@ -149,7 +149,7 @@ int main(int argc, char *argv[]) printf("test end processing "); for (i = 0; i < data_len[3]; i++) { RC4_set_key(&key, keys[3][0], &(keys[3][1])); - memset(obuf, 0x00, sizeof(obuf)); + memset(obuf, 0, sizeof(obuf)); RC4(&key, i, &(data[3][0]), obuf); if ((memcmp(obuf, output[3], i) != 0) || (obuf[i] != 0)) { printf("error in RC4 length processing\n"); @@ -172,7 +172,7 @@ int main(int argc, char *argv[]) printf("test multi-call "); for (i = 0; i < data_len[3]; i++) { RC4_set_key(&key, keys[3][0], &(keys[3][1])); - memset(obuf, 0x00, sizeof(obuf)); + memset(obuf, 0, sizeof(obuf)); RC4(&key, i, &(data[3][0]), obuf); RC4(&key, data_len[3] - i, &(data[3][i]), &(obuf[i])); if (memcmp(obuf, output[3], data_len[3] + 1) != 0) { @@ -203,7 +203,7 @@ int main(int argc, char *argv[]) }; RC4_set_key(&key, keys[0][0], &(keys[3][1])); - memset(buf, '\0', sizeof(buf)); + memset(buf, 0, sizeof(buf)); SHA1_Init(&c); for (i = 0; i < 2571; i++) { RC4(&key, sizeof(buf), buf, buf); |