Avoid C99 for loop