diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2020-10-12 22:08:35 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2020-10-12 22:08:35 +0000 |
commit | a575eb26f0ae95d94ff18ee8b482e93c08feb91b (patch) | |
tree | 12eda421b3d080a63f6605f44cc731ab0fa3d34e /lib/libcrypto/arc4random | |
parent | ef53b0617ae0009192465f85b3eebc8715d9108d (diff) |
make fixed-sized fixed-value mib[] arrays be const
ok guenther tb millert
Diffstat (limited to 'lib/libcrypto/arc4random')
-rw-r--r-- | lib/libcrypto/arc4random/getentropy_freebsd.c | 6 | ||||
-rw-r--r-- | lib/libcrypto/arc4random/getentropy_netbsd.c | 6 |
2 files changed, 4 insertions, 8 deletions
diff --git a/lib/libcrypto/arc4random/getentropy_freebsd.c b/lib/libcrypto/arc4random/getentropy_freebsd.c index 30cd68e97d6..ea90ffe2022 100644 --- a/lib/libcrypto/arc4random/getentropy_freebsd.c +++ b/lib/libcrypto/arc4random/getentropy_freebsd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getentropy_freebsd.c,v 1.3 2016/08/07 03:27:21 tb Exp $ */ +/* $OpenBSD: getentropy_freebsd.c,v 1.4 2020/10/12 22:08:33 deraadt Exp $ */ /* * Copyright (c) 2014 Pawel Jakub Dawidek <pjd@FreeBSD.org> @@ -32,11 +32,9 @@ static size_t getentropy_sysctl(u_char *buf, size_t size) { - int mib[2]; + const int mib[2] = { CTL_KERN, KERN_ARND }; size_t len, done; - mib[0] = CTL_KERN; - mib[1] = KERN_ARND; done = 0; do { diff --git a/lib/libcrypto/arc4random/getentropy_netbsd.c b/lib/libcrypto/arc4random/getentropy_netbsd.c index 45d68c9fda4..5dc89594cd9 100644 --- a/lib/libcrypto/arc4random/getentropy_netbsd.c +++ b/lib/libcrypto/arc4random/getentropy_netbsd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getentropy_netbsd.c,v 1.3 2016/08/07 03:27:21 tb Exp $ */ +/* $OpenBSD: getentropy_netbsd.c,v 1.4 2020/10/12 22:08:33 deraadt Exp $ */ /* * Copyright (c) 2014 Pawel Jakub Dawidek <pjd@FreeBSD.org> @@ -32,11 +32,9 @@ static size_t getentropy_sysctl(u_char *buf, size_t size) { - int mib[2]; + const int mib[2] = { CTL_KERN, KERN_ARND }; size_t len, done; - mib[0] = CTL_KERN; - mib[1] = KERN_ARND; done = 0; do { |