diff --git a/Utils.cpp b/Utils.cpp index a0a0e66c..ffbf27c2 100644 --- a/Utils.cpp +++ b/Utils.cpp @@ -257,7 +257,11 @@ bool CUtils::GetInput(const CString& sPrompt, CString& sRet, const CString& sDef PrintPrompt(sPrompt + sExtra); char szBuf[1024]; memset(szBuf, 0, 1024); - fgets(szBuf, 1024, stdin); + if (fgets(szBuf, 1024, stdin) == NULL) { + // Reading failed (Error? EOF?) + PrintError("Error while reading from stdin. Exiting..."); + exit(-1); + } sInput = szBuf; if (sInput.Right(1) == "\n") {