Skip to content

Commit

Permalink
Fixed double declaration of variable i
Browse files Browse the repository at this point in the history
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 9, 2015
1 parent a416895 commit d511f6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/bregex.c
Expand Up @@ -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];
}
Expand Down

0 comments on commit d511f6e

Please sign in to comment.