Doctor! It hurts when I do this! Don't use scanf if you have the slightest doubt about its ability to solve the problem. For this one I'd use regexp or equivalents if I wanted to be lazy, or strchr() in a loop if I wanted to do it right. -- Peter da Silva. `-_-' +1 713 274 5180. 'U` peter at ferranti.com