Update servlist.c

Replace while by for when processing lists