right. It should be strlen(buff ) thanks everyone for your help. I think I will try fgets instead. regards J.A.Serralheiro