You don't have to watch for any string "EOF" at the end of the input. EOF stands for End Of File and means "no data", that is, after the last description of a board there is nothing. In C, you should do something like this:
where buffer is an array of at least 64+1 chars.