Declare variables before executing any statement to follow
C standards.

Report and original patch by Gisle Vanem.