Removing redundant null byte from end of json header

This commit is contained in:
maliakal_d 2018-09-17 12:32:33 +02:00
parent 14c899e7cf
commit d67b4765ea

View File

@ -285,7 +285,7 @@ public:
//additional stuff //additional stuff
"\"flippedDataX\":%u" "\"flippedDataX\":%u"
;//"}\n\0"; ;//"}\n";
int length = sprintf(buf, jsonHeaderFormat, int length = 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,9 +298,9 @@ 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%c", buf, additionalJsonHeader, '\0'); length = sprintf(buf, "%s, %s}\n", buf, additionalJsonHeader);
} else { } else {
length = sprintf(buf, "%s}\n%c", buf, '\0'); length = sprintf(buf, "%s}\n", buf);
} }
#ifdef VERBOSE #ifdef VERBOSE