From 65943b3712c663f213c4fcc82276ae70fd84e54e Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Tue, 1 Nov 2022 14:51:37 +0800 Subject: [PATCH] chore: revert the code change --- source/dnode/mnode/impl/test/db/CMakeLists.txt | 1 - source/dnode/vnode/src/tsdb/tsdbOpen.c | 4 ++-- source/libs/tfs/test/CMakeLists.txt | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/source/dnode/mnode/impl/test/db/CMakeLists.txt b/source/dnode/mnode/impl/test/db/CMakeLists.txt index ca8286b2f6..3f6a80835f 100644 --- a/source/dnode/mnode/impl/test/db/CMakeLists.txt +++ b/source/dnode/mnode/impl/test/db/CMakeLists.txt @@ -9,4 +9,3 @@ add_test( NAME dbTest COMMAND dbTest ) - diff --git a/source/dnode/vnode/src/tsdb/tsdbOpen.c b/source/dnode/vnode/src/tsdb/tsdbOpen.c index a1012a26a6..efc74b68ba 100644 --- a/source/dnode/vnode/src/tsdb/tsdbOpen.c +++ b/source/dnode/vnode/src/tsdb/tsdbOpen.c @@ -38,7 +38,7 @@ int tsdbOpen(SVnode *pVnode, STsdb **ppTsdb, const char *dir, STsdbKeepCfg *pKee int slen = 0; *ppTsdb = NULL; - slen = 260; + slen = strlen(pVnode->path) + strlen(dir) + 2; // create handle pTsdb = (STsdb *)taosMemoryCalloc(1, sizeof(*pTsdb) + slen); @@ -48,7 +48,7 @@ int tsdbOpen(SVnode *pVnode, STsdb **ppTsdb, const char *dir, STsdbKeepCfg *pKee } pTsdb->path = (char *)&pTsdb[1]; - snprintf(pTsdb->path, 260, "%s%s%s", pVnode->path, TD_DIRSEP, dir); + sprintf(pTsdb->path, "%s%s%s", pVnode->path, TD_DIRSEP, dir); taosRealPath(pTsdb->path, NULL, slen); pTsdb->pVnode = pVnode; taosThreadRwlockInit(&pTsdb->rwLock, NULL); diff --git a/source/libs/tfs/test/CMakeLists.txt b/source/libs/tfs/test/CMakeLists.txt index 6b0f747147..ee28dcf723 100644 --- a/source/libs/tfs/test/CMakeLists.txt +++ b/source/libs/tfs/test/CMakeLists.txt @@ -9,6 +9,6 @@ target_link_libraries( ) add_test( - NAME tfs_test - COMMAND tfs_test + NAME tfs_test + COMMAND tfs_test )