Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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
  • Loading branch information
pstorz authored and Marco van Wieringen committed Nov 14, 2015
1 parent 2e52b56 commit 86cc27e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/bregex.c
Expand Up @@ -1479,7 +1479,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];
}
Expand Down

0 comments on commit 86cc27e

Please sign in to comment.