From 770ca7bb96db772d105b40abd697c9328b0ca16b Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Thu, 19 Mar 2020 11:15:49 +0100 Subject: [PATCH] zmq fix sprintf serveraddress --- slsReceiverSoftware/include/ZmqSocket.h | 4 +++- slsReceiverSoftware/src/DataProcessor.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/slsReceiverSoftware/include/ZmqSocket.h b/slsReceiverSoftware/include/ZmqSocket.h index f06fe1753..721158597 100644 --- a/slsReceiverSoftware/include/ZmqSocket.h +++ b/slsReceiverSoftware/include/ZmqSocket.h @@ -56,8 +56,10 @@ public: (ConvertInternetAddresstoIpString(result, ip, MAX_STR_LENGTH))) throw std::exception(); + 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 diff --git a/slsReceiverSoftware/src/DataProcessor.cpp b/slsReceiverSoftware/src/DataProcessor.cpp index bce6e0379..54b8bbb06 100644 --- a/slsReceiverSoftware/src/DataProcessor.cpp +++ b/slsReceiverSoftware/src/DataProcessor.cpp @@ -146,7 +146,7 @@ void DataProcessor::ResetParametersforNewMeasurement(){ delete [] tempBuffer; tempBuffer = 0; } - if (*gapPixelsEnable >= 0) { + if (*gapPixelsEnable) { tempBuffer = new char[generalData->imageSize]; memset(tempBuffer, 0, generalData->imageSize); }