Now replaced the sprintf/fputs in writeOut by fprintf. One line and one operation saved =)