Fix declaration of ‘index’ shadows a global declaration [-Werror=shadow]

I have this error with some old gcc (4.6) release (Ubuntu 12.04 or Travis...)