Move division by two out of sizeof()
authortb <tb@openbsd.org>
Mon, 12 Sep 2022 04:26:38 +0000 (04:26 +0000)
committertb <tb@openbsd.org>
Mon, 12 Sep 2022 04:26:38 +0000 (04:26 +0000)
regress/lib/libcrypto/rc4/rc4_test.c

index 49da635..4f5ea62 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: rc4_test.c,v 1.4 2022/09/07 21:17:32 tb Exp $ */
+/*     $OpenBSD: rc4_test.c,v 1.5 2022/09/12 04:26:38 tb Exp $ */
 /*
  * Copyright (c) 2022 Joshua Sing <joshua@hypera.dev>
  *
@@ -377,7 +377,7 @@ rc4_test(void)
                }
 
                for (j = 0; j < rt->len;) {
-                       in_len = arc4random_uniform(sizeof(rt->len / 2));
+                       in_len = arc4random_uniform(sizeof(rt->len) / 2);
                        if (in_len > rt->len - j)
                                in_len = rt->len - j;
 
@@ -423,7 +423,7 @@ rc4_test(void)
                }
 
                for (j = 0; j < rt->len;) {
-                       in_len = arc4random_uniform(sizeof(rt->len / 2));
+                       in_len = arc4random_uniform(sizeof(rt->len) / 2);
                        if (in_len > rt->len - j)
                                in_len = rt->len - j;