CUtils::GetInput(): Kill ZNC if reading from stdin fails

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1109 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2008-06-28 10:26:41 +00:00
parent fb0ccc3cf0
commit e3683f204b
+5 -1
View File
@@ -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") {