diff --git a/src/tsdb/src/tsdbFile.c b/src/tsdb/src/tsdbFile.c index 67696e48a572c29d0d6a33d4359236162f50cd28..77d172893e5ee176e636c8f0e5f3ed15ed86be2e 100644 --- a/src/tsdb/src/tsdbFile.c +++ b/src/tsdb/src/tsdbFile.c @@ -79,7 +79,7 @@ void *tsdbDecodeSMFileEx(void *buf, SMFile *pMFile) { char *aname; buf = tsdbDecodeMFInfo(buf, &(pMFile->info)); buf = taosDecodeString(buf, &aname); - strncpy(TSDB_FILE_FULL_NAME(pMFile), aname, TSDB_FILENAME_LEN); + tstrncpy(TSDB_FILE_FULL_NAME(pMFile), aname, TSDB_FILENAME_LEN); TSDB_FILE_SET_CLOSED(pMFile); tfree(aname); @@ -345,7 +345,7 @@ static void *tsdbDecodeSDFileEx(void *buf, SDFile *pDFile) { // The sync module would send DFileSet with latest verion. buf = tsdbDecodeDFInfo(buf, &(pDFile->info), TSDB_LATEST_SFS_VER); buf = taosDecodeString(buf, &aname); - strncpy(TSDB_FILE_FULL_NAME(pDFile), aname, TSDB_FILENAME_LEN); + tstrncpy(TSDB_FILE_FULL_NAME(pDFile), aname, TSDB_FILENAME_LEN); TSDB_FILE_SET_CLOSED(pDFile); tfree(aname); @@ -716,4 +716,4 @@ static void tsdbGetFilename(int vid, int fid, uint32_t ver, TSDB_FILE_T ftype, c snprintf(fname, TSDB_FILENAME_LEN, "vnode/vnode%d/tsdb/%s-ver%" PRIu32, vid, TSDB_FNAME_SUFFIX[ftype], ver); } } -} \ No newline at end of file +}