ARM defaults char's as unsigned -> comparing (unsigned) char and EOF will fail