FIO_determineDstName: extract dstFileNameEndPos variable

This commit is contained in:
Sergey Ponomarev 2019-09-18 09:21:00 +03:00
parent 59f369a6da
commit bfb4d830b2

View File

@ -2210,8 +2210,9 @@ FIO_determineDstName(const char* srcFileName)
/* return dst name == src name truncated from suffix */
assert(dstFileNameBuffer != NULL);
memcpy(dstFileNameBuffer, srcFileName, sfnSize - suffixSize);
dstFileNameBuffer[sfnSize-suffixSize] = '\0';
size_t dstFileNameEndPos = sfnSize - suffixSize;
memcpy(dstFileNameBuffer, srcFileName, dstFileNameEndPos);
dstFileNameBuffer[dstFileNameEndPos] = '\0';
return dstFileNameBuffer;
/* note : dstFileNameBuffer memory is not going to be free */