From d511f6e827f08335287fe0caf027e5493b3585c0 Mon Sep 17 00:00:00 2001 From: Philipp Storz Date: Mon, 9 Nov 2015 13:34:09 +0100 Subject: [PATCH] Fixed double declaration of variable i This makes the loop variable shadow the variable with a wider scope and as such it doesn't have a defined value after the loops exits. Fixes #556: File Relocation does not work --- src/lib/bregex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/bregex.c b/src/lib/bregex.c index eb8318c690e..146c83bf84b 100644 --- a/src/lib/bregex.c +++ b/src/lib/bregex.c @@ -1481,7 +1481,7 @@ void re_registers_to_regmatch(regexp_registers_t old_regs, * We have to set the last entry to -1 */ nmatch = nmatch - 1; - for (size_t i = 0; (i < nmatch) && (old_regs->start[i] > -1) ; i++) { + for (i = 0; (i < nmatch) && (old_regs->start[i] > -1) ; i++) { pmatch[i].rm_so = old_regs->start[i]; pmatch[i].rm_eo = old_regs->end[i]; }