I will use puts(), as suggested by kaspar.
Maybe adding a static variable in the function could also help infinite looping avoidance.