Update ata.c

Swapped the `goto` with a normal loop.