fix: unused return value
This commit is contained in:
parent
badc3fd399
commit
0bc6bf62a4
|
@ -2,7 +2,9 @@
|
||||||
|
|
||||||
void array_set_random_bytes(uint32_t *n, size_t size) {
|
void array_set_random_bytes(uint32_t *n, size_t size) {
|
||||||
int fd = open("/dev/urandom", O_RDONLY);
|
int fd = open("/dev/urandom", O_RDONLY);
|
||||||
read(fd, n, size);
|
if (read(fd, n, size) == -1) {
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void array_set_msb_and_lsb_to_one(uint32_t *n, size_t size) {
|
void array_set_msb_and_lsb_to_one(uint32_t *n, size_t size) {
|
||||||
|
|
|
@ -6,7 +6,9 @@ void my_memcpy(void *dst, void *src, size_t n) {
|
||||||
|
|
||||||
void bigint_set_random_bytes(bigint_t n, size_t len) {
|
void bigint_set_random_bytes(bigint_t n, size_t len) {
|
||||||
int fd = open("/dev/urandom", O_RDONLY);
|
int fd = open("/dev/urandom", O_RDONLY);
|
||||||
read(fd, n.data, len * sizeof(uint32_t));
|
if (read(fd, n.data, len * sizeof(uint32_t)) == -1) {
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue