tmp = tmp->next means "move tmp to the next node", which is exactly what you need to do to traverse the list. You are not, in any way shape or form, modifying the content of the list. tmp must of course be set to something useful at the start of the function, and you need to check in every iteration that tmp is not NULL.
--
Mats