]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
stdlib: Fix tst-getrandom memcmp call
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 24 Mar 2022 18:17:12 +0000 (15:17 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 31 Mar 2022 12:14:10 +0000 (09:14 -0300)
The idea is to check if the up sizeof (buf) are equal, not only
the first byte.

Checked on x86_64-linux-gnu and i686-linux-gnu.

stdlib/tst-getrandom.c

index 608fc4746eed3ed69b53bd532c1db8dfa4316bad..61c3cae92e5e5c545c65a17ee3dcd2f71f631ee3 100644 (file)
@@ -189,7 +189,7 @@ test_getentropy (void)
 
   /* The probability that these two buffers are equal is very
      small. */
-  if (memcmp (buf, buf2, sizeof (buf) == 0))
+  if (memcmp (buf, buf2, sizeof (buf)) == 0)
     {
       printf ("error: getentropy appears to return constant bytes\n");
       errors = true;