diff --git a/slsReceiverSoftware/include/ZmqSocket.h b/slsReceiverSoftware/include/ZmqSocket.h index e58419a1e..5b569f94a 100644 --- a/slsReceiverSoftware/include/ZmqSocket.h +++ b/slsReceiverSoftware/include/ZmqSocket.h @@ -286,7 +286,7 @@ public: "\"flippedDataX\":%u" ;//"}\n"; - int length = sprintf(buf, jsonHeaderFormat, + sprintf(buf, jsonHeaderFormat, jsonversion, dynamicrange, fileIndex, npixelsx, npixelsy, imageSize, acqIndex, fIndex, (fname == NULL)? "":fname, dummy?0:1, @@ -298,10 +298,12 @@ public: ((flippedData == 0 ) ? 0 :flippedData[0]) ); if (additionalJsonHeader && strlen(additionalJsonHeader)) { - length = sprintf(buf, "%s, %s}\n", buf, additionalJsonHeader); - } else { - length = sprintf(buf, "%s}\n", buf); + strcat(buf, ", "); + strcat(buf, additionalJsonHeader); } + strcat(buf,"}\n"); + int length = strlen(buf); + #ifdef VERBOSE //if(!index)