Fix for C99 error

‘for’ loop initial declarations are only allowed in C99 mode (at least with "-Werror -Wall"