You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

36 lines
1023 B

From 337d06b4c2f5f779de835c5eb54846db330b33cf Mon Sep 17 00:00:00 2001
From: XScreenSaver owners <xscreensaver-owner@fedoraproject.org>
Date: Mon, 16 Apr 2018 21:39:38 +0900
Subject: [PATCH] crumbler: fix loop enclosure for calculating keys in
split_chunk
In split_chunk(), unique keys should be assigned to each chunks,
however current loop for calculating keys has logical mistake.
Fix this.
---
hacks/glx/crumbler.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/hacks/glx/crumbler.c b/hacks/glx/crumbler.c
index f9a908a..b4420e7 100644
--- a/hacks/glx/crumbler.c
+++ b/hacks/glx/crumbler.c
@@ -352,12 +352,14 @@ split_chunk (ModeInfo *mi, chunk *c, int nchunks)
do {
keys[i] = random() % c->nverts;
for (j = 0; j < i; j++)
+ {
if (keys[i] == keys[j])
{
ok = False;
break;
}
- ok = True;
+ ok = True;
+ }
} while (!ok);
c2 = make_chunk();
--
2.17.0