Fix some gcc 4.3 warnings

These are mostly string casts, handling function's return value and some
weird warning about missing spaces on empty while loops.

These were reported by and fixed with Marcus Rueckert <darix@opensu.se>.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@904 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2007-12-20 18:31:48 +00:00
parent db9694836e
commit b490b12058
5 changed files with 35 additions and 19 deletions
+9 -6
View File
@@ -280,7 +280,7 @@ bool CZNC::WritePemFile( bool bEncPem ) {
return false;
}
while (!CUtils::GetInput("hostname of your shell", sHost, sHost, "including the '.com' portion"));
while (!CUtils::GetInput("hostname of your shell", sHost, sHost, "including the '.com' portion")) ;
CUtils::PrintAction("Writing Pem file [" + sPemFile + "]");
FILE *f = fopen(sPemFile.c_str(), "w");
@@ -330,7 +330,10 @@ bool CZNC::IsHostAllowed(const CString& sHostMask) {
void CZNC::InitDirs(const CString& sArgvPath, const CString& sDataDir) {
char buf[PATH_MAX];
getcwd(buf, PATH_MAX);
if (getcwd(buf, PATH_MAX) == NULL) {
CUtils::PrintError("getcwd() failed, can't read my current dir");
exit(-1);
}
// If the bin was not ran from the current directory, we need to add that dir onto our cwd
CString::size_type uPos = sArgvPath.rfind('/');
@@ -480,7 +483,7 @@ bool CZNC::WriteNewConfig(const CString& sConfig) {
// Listen
unsigned int uPort = 0;
while(!CUtils::GetNumInput("What port would you like ZNC to listen on?", uPort, 1, 65535));
while(!CUtils::GetNumInput("What port would you like ZNC to listen on?", uPort, 1, 65535)) ;
CString sSSL;
#ifdef HAVE_LIBSSL
@@ -653,8 +656,8 @@ bool CZNC::WriteNewConfig(const CString& sConfig) {
bool bSSL = false;
unsigned int uPort = 0;
while(!CUtils::GetInput("IRC server", sHost, "", "host only") || !CServer::IsValidHostName(sHost));
while(!CUtils::GetNumInput("[" + sHost + "] Port", uPort, 1, 65535, 6667));
while(!CUtils::GetInput("IRC server", sHost, "", "host only") || !CServer::IsValidHostName(sHost)) ;
while(!CUtils::GetNumInput("[" + sHost + "] Port", uPort, 1, 65535, 6667)) ;
CUtils::GetInput("[" + sHost + "] Password (probably empty)", sPass);
#ifdef HAVE_LIBSSL
@@ -674,7 +677,7 @@ bool CZNC::WriteNewConfig(const CString& sConfig) {
bool bDefault = true;
while (CUtils::GetBoolInput("Would you like to add " + sArg + " channel" + sPost, bDefault)) {
while (!CUtils::GetInput("Channel name", sAnswer));
while (!CUtils::GetInput("Channel name", sAnswer)) ;
vsLines.push_back("\t<Chan " + sAnswer + ">");
vsLines.push_back("\t</Chan>");
sArg = "another";