mirror of
https://github.com/znc/znc.git
synced 2026-08-06 17:03:14 +02:00
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:
@@ -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") {
|
||||
|
||||
Reference in New Issue
Block a user