Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.busybox.net/busybox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2022-04-27 18:09:38 +0300
committerDenys Vlasenko <vda.linux@googlemail.com>2022-04-27 18:09:38 +0300
commit6da9947358276d989e002c3c5c8ff2e33676ae21 (patch)
tree1395c08ada4816b1d567d7ee95d396da746f158c /util-linux
parent137b205722ed9a2e20f145d2f3e4106e8970fdad (diff)
seedrng: remove unnecessary zero-filling of local variables
function old new delta seedrng_main 1323 1292 -31 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/seedrng.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/util-linux/seedrng.c b/util-linux/seedrng.c
index 6c02b735f..c762e9ecd 100644
--- a/util-linux/seedrng.c
+++ b/util-linux/seedrng.c
@@ -103,16 +103,16 @@ static int seed_rng(uint8_t *seed, size_t len, bool credit)
int entropy_count;
int buf_size;
uint8_t buffer[MAX_SEED_LEN];
- } req = {
- .entropy_count = credit ? len * 8 : 0,
- .buf_size = len
- };
+ } req;
int random_fd, ret;
if (len > sizeof(req.buffer)) {
errno = EFBIG;
return -1;
}
+
+ req.entropy_count = credit ? len * 8 : 0;
+ req.buf_size = len;
memcpy(req.buffer, seed, len);
random_fd = open("/dev/urandom", O_RDONLY);
@@ -164,7 +164,7 @@ int seedrng_main(int argc UNUSED_PARAM, char *argv[])
uint8_t new_seed[MAX_SEED_LEN];
size_t new_seed_len;
bool new_seed_creditable, skip_credit = false;
- struct timespec timestamp = { 0 };
+ struct timespec timestamp;
sha256_ctx_t hash;
enum {