From 6b984ab44878db3248a1dc95b6f1976f1e20dace Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Mon, 10 Oct 2022 10:23:57 +0800 Subject: [PATCH] fix: coverity scan for sma and tfs --- source/dnode/vnode/src/sma/smaSnapshot.c | 2 +- source/libs/tfs/src/tfs.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/dnode/vnode/src/sma/smaSnapshot.c b/source/dnode/vnode/src/sma/smaSnapshot.c index db9fcde85a..34f884f9f9 100644 --- a/source/dnode/vnode/src/sma/smaSnapshot.c +++ b/source/dnode/vnode/src/sma/smaSnapshot.c @@ -376,7 +376,7 @@ int32_t rsmaSnapWriterClose(SRSmaSnapWriter** ppWriter, int8_t rollback) { if (taosRemoveFile(pWriter->pQTaskFWriter->fname) != 0) { smaWarn("vgId:%d, vnode snapshot rsma writer failed to remove %s since %s", SMA_VID(pWriter->pSma), pWriter->pQTaskFWriter->fname ? pWriter->pQTaskFWriter->fname : "NULL", - terrstr(TAOS_SYSTEM_ERROR(errno))); + tstrerror(TAOS_SYSTEM_ERROR(errno))); } } } else { diff --git a/source/libs/tfs/src/tfs.c b/source/libs/tfs/src/tfs.c index a78d324622..b8786a85a9 100644 --- a/source/libs/tfs/src/tfs.c +++ b/source/libs/tfs/src/tfs.c @@ -354,7 +354,7 @@ const STfsFile *tfsReaddir(STfsDir *pTfsDir) { char *name = taosGetDirEntryName(pDirEntry); if (strcmp(name, ".") == 0 || strcmp(name, "..") == 0) continue; - if (pTfsDir->dirName == NULL || pTfsDir->dirName[0] == 0) { + if (pTfsDir->dirName[0] == 0) { snprintf(bname, TMPNAME_LEN * 2, "%s", name); } else { snprintf(bname, TMPNAME_LEN * 2, "%s%s%s", pTfsDir->dirName, TD_DIRSEP, name); -- GitLab