Merge pull request #2 from 1player/main

apps/maze: fix possible stack overflow
This commit is contained in:
Toby Jaffey 2025-12-14 09:37:50 +00:00 committed by GitHub
commit b7269c23b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -42,7 +42,7 @@ void carve(int x, int y) {
int dirs[] = {0, 1, 2, 3};
// Fisher-Yates shuffle
for (int i = 3; i > 0; i--) {
int j = mulberry32() % (i + 1);
int j = (unsigned)mulberry32() % (i + 1);
int tmp = dirs[i];
dirs[i] = dirs[j];
dirs[j] = tmp;