From c5035fba8190eedb9078a458191b060106d6720b Mon Sep 17 00:00:00 2001 From: Vftdan Date: Sun, 25 Feb 2024 00:50:21 +0100 Subject: [PATCH] Fix infinite loop in the fix from the last commit --- src/sfxd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sfxd.c b/src/sfxd.c index 63ca7fb..e0382f1 100644 --- a/src/sfxd.c +++ b/src/sfxd.c @@ -17,7 +17,7 @@ #define MAX_SOURCE_DEPTH 32 // Set initial offset to size to distinguish start and end -#define FOR_OFFSET_PROBE(base, offset, index, size) for (int offset = 0, index = (base) % (size); offset >= 0; offset = ((offset + 1) << 1L) % (((size) + 1) | 1) - 1, offset = offset == (size) ? (size) - 1 /* n * 2 = n - 1 (mod n + 1) */ : offset, index = ((base) + offset) % (size)) +#define FOR_OFFSET_PROBE(base, offset, index, size) for (int offset = 0, index = (base) % (size); offset >= 0; offset = ((offset + 1) << 1L) % (((size) + 1) | 1) - 1, offset = offset == (size) ? (size) - 1 /* n * 2 = n - 1 (mod n + 1) */ : offset, index = ((base) + offset) % (size), offset = offset == 0 ? -1 : offset) struct msg_target { FILE *file_handle;