check return values in stdio initialization, to give better errors