fix invalid copy

This commit is contained in:
yihaoDeng 2022-11-02 21:05:53 +08:00
parent ff16c4368f
commit fd3ece836a
1 changed files with 1 additions and 1 deletions

View File

@ -152,7 +152,7 @@ IFileCtx* idxFileCtxCreate(WriterType type, const char* path, bool readOnly, int
if (ctx->type == TFILE) {
// ugly code, refactor later
ctx->file.readOnly = readOnly;
memcpy(ctx->file.buf, path, sizeof(ctx->file.buf));
memcpy(ctx->file.buf, path, strlen(path));
if (readOnly == false) {
ctx->file.pFile = taosOpenFile(path, TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_APPEND);
taosFtruncateFile(ctx->file.pFile, 0);