zmqsocket bug fix: memcpy source and destination overlap

This commit is contained in:
Dhanya Thattil
2020-02-25 10:28:23 +01:00
committed by GitHub
parent 63f5b52a6e
commit e61d1a1651

View File

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