Should really protect against fclosing stdin further on.