mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-23 06:50:02 +02:00
replaced sprintf on the same buffer with strcat
This commit is contained in:
parent
4a8a72c447
commit
d0e1289c1b
@ -254,7 +254,7 @@ public:
|
||||
char* additionalJsonHeader = 0) {
|
||||
|
||||
|
||||
char buf[MAX_STR_LENGTH] = "";
|
||||
|
||||
/** Json Header Format */
|
||||
const char* jsonHeaderFormat =
|
||||
"{"
|
||||
@ -286,7 +286,8 @@ public:
|
||||
"\"flippedDataX\":%u"
|
||||
|
||||
;//"}\n";
|
||||
int length = sprintf(buf, jsonHeaderFormat,
|
||||
char buf[MAX_STR_LENGTH] = "";
|
||||
sprintf(buf, jsonHeaderFormat,
|
||||
jsonversion, dynamicrange, fileIndex, npixelsx, npixelsy, imageSize,
|
||||
acqIndex, fIndex, (fname == NULL)? "":fname, dummy?0:1,
|
||||
|
||||
@ -297,11 +298,13 @@ public:
|
||||
//additional stuff
|
||||
((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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user