more conservative approach to solve problem reading 0 using fgetc()