aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2021-05-10 08:25:15 +0200
committerGravatar Christian Hesse <mail@eworm.de>2021-05-10 08:25:15 +0200
commit4255c4610195920ac3e53d8ea5b37a4386125c26 (patch)
tree32d797bf29f3b2e91f1a091dfba0e20a846c772e /bin
parent9d6d51c507802d388beaa7b7082b8f3671ad58b2 (diff)
downloadmkinitcpio-ykfde-4255c4610195920ac3e53d8ea5b37a4386125c26.tar.gz
mkinitcpio-ykfde-4255c4610195920ac3e53d8ea5b37a4386125c26.tar.zst
make the compiler happy
Depending on build flags the compiler complains: ykfde.c:307:3: error: ignoring return value of ‘getrandom’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result] Let's add the return value to `len`, which is no longer used anyway. Fixes #33
Diffstat (limited to 'bin')
-rw-r--r--bin/ykfde.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/ykfde.c b/bin/ykfde.c
index 27aecc3..4460e48 100644
--- a/bin/ykfde.c
+++ b/bin/ykfde.c
@@ -304,7 +304,7 @@ int main(int argc, char **argv) {
We generate an array of unsigned int, the use modulo to limit to printable
ASCII characters (32 to 127). */
if ((len = getrandom(challenge_int, CHALLENGELEN * sizeof(unsigned int), GRND_RANDOM|GRND_NONBLOCK)) != CHALLENGELEN * sizeof(unsigned int))
- getrandom((void *)((size_t)challenge_int + len), CHALLENGELEN * sizeof(unsigned int) - len, 0);
+ len += getrandom((void *)((size_t)challenge_int + len), CHALLENGELEN * sizeof(unsigned int) - len, 0);
for (i = 0; i < CHALLENGELEN; i++)
challenge_new[i] = (challenge_int[i] % (127 - 32)) + 32;