zmq server address copy warning fix

This commit is contained in:
maliakal_d 2020-03-19 11:36:32 +01:00
parent 40c5ccfe37
commit 75692c3539

View File

@ -23,8 +23,9 @@ ZmqSocket::ZmqSocket(const char *const hostname_or_ip,
(ConvertInternetAddresstoIpString(result, ip, MAX_STR_LENGTH)))
throw sls::ZmqSocketError("Could convert IP to string");
std::string sip(ip);
// construct address
sprintf(sockfd.serverAddress, "tcp://%s:%d", ip, portno);
sprintf(sockfd.serverAddress, "tcp://%s:%d", sip.c_str(), portno);
#ifdef VERBOSE
cprintf(BLUE, "address:%s\n", sockfd.serverAddress);
#endif