Are you sure that you're entering the loop? To enter that loop the value of done must be zero. Post a short example that both compiles and demonstrates the problem - without seeing how you've set up the variables you're using it's hard to see what you're doing wrong.