mirror of
https://github.com/glest/glest-source.git
synced 2025-08-20 23:21:19 +02:00
- fixed windows build from coverity updates
This commit is contained in:
@@ -2444,7 +2444,11 @@ string safeCharPtrCopy(const char *ptr,int maxLength) {
|
||||
|
||||
char *pBuffer = new char[maxLength+1];
|
||||
memset(pBuffer,0,maxLength+1);
|
||||
#ifdef WIN32
|
||||
memcpy(pBuffer,ptr,min((int)strlen(ptr),maxLength));
|
||||
#else
|
||||
memcpy(pBuffer,ptr,std::min((int)strlen(ptr),maxLength));
|
||||
#endif
|
||||
return pBuffer;
|
||||
}
|
||||
|
||||
|
@@ -75,7 +75,11 @@ void dump_event (irc_session_t * session, const char * event, const char * origi
|
||||
if ( cnt ) {
|
||||
strcat (buf, "|");
|
||||
}
|
||||
#ifdef WIN32
|
||||
strncat (buf, params[cnt],min((int)strlen(params[cnt]),511));
|
||||
#else
|
||||
strncat (buf, params[cnt],std::min((int)strlen(params[cnt]),511));
|
||||
#endif
|
||||
}
|
||||
|
||||
addlog ("Event \"%s\", origin: \"%s\", params: %d [%s]", event, origin ? origin : "NULL", cnt, buf);
|
||||
|
@@ -2430,8 +2430,13 @@ Socket *ServerSocket::accept(bool errorOnFail) {
|
||||
throwException(szBuf);
|
||||
}
|
||||
else {
|
||||
::close(newSock);
|
||||
newSock = INVALID_SOCKET;
|
||||
#ifndef WIN32
|
||||
::close(newSock);
|
||||
newSock = INVALID_SOCKET;
|
||||
#else
|
||||
::closesocket(newSock);
|
||||
newSock = INVALID_SOCKET;
|
||||
#endif
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -2925,7 +2930,11 @@ void BroadCastSocketThread::execute() {
|
||||
strcat(buff,ipList[idx1].c_str());
|
||||
strcat(buff,":");
|
||||
string port_string = intToStr(this->boundPort);
|
||||
#ifdef WIN32
|
||||
strncat(buff,port_string.c_str(),min((int)port_string.length(),100));
|
||||
#else
|
||||
strncat(buff,port_string.c_str(),std::min((int)port_string.length(),100));
|
||||
#endif
|
||||
}
|
||||
|
||||
if(difftime((long int)time(NULL),elapsed) >= 1 && getQuitStatus() == false) {
|
||||
|
Reference in New Issue
Block a user