> while (!feof(inputStream))
See the FAQ.

And yes, checking your return results would be a good idea.