提交 6b984ab4 编写于 作者: C Cary Xu

fix: coverity scan for sma and tfs

上级 37c2fd5b
...@@ -376,7 +376,7 @@ int32_t rsmaSnapWriterClose(SRSmaSnapWriter** ppWriter, int8_t rollback) { ...@@ -376,7 +376,7 @@ int32_t rsmaSnapWriterClose(SRSmaSnapWriter** ppWriter, int8_t rollback) {
if (taosRemoveFile(pWriter->pQTaskFWriter->fname) != 0) { if (taosRemoveFile(pWriter->pQTaskFWriter->fname) != 0) {
smaWarn("vgId:%d, vnode snapshot rsma writer failed to remove %s since %s", SMA_VID(pWriter->pSma), smaWarn("vgId:%d, vnode snapshot rsma writer failed to remove %s since %s", SMA_VID(pWriter->pSma),
pWriter->pQTaskFWriter->fname ? pWriter->pQTaskFWriter->fname : "NULL", pWriter->pQTaskFWriter->fname ? pWriter->pQTaskFWriter->fname : "NULL",
terrstr(TAOS_SYSTEM_ERROR(errno))); tstrerror(TAOS_SYSTEM_ERROR(errno)));
} }
} }
} else { } else {
......
...@@ -354,7 +354,7 @@ const STfsFile *tfsReaddir(STfsDir *pTfsDir) { ...@@ -354,7 +354,7 @@ const STfsFile *tfsReaddir(STfsDir *pTfsDir) {
char *name = taosGetDirEntryName(pDirEntry); char *name = taosGetDirEntryName(pDirEntry);
if (strcmp(name, ".") == 0 || strcmp(name, "..") == 0) continue; 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); snprintf(bname, TMPNAME_LEN * 2, "%s", name);
} else { } else {
snprintf(bname, TMPNAME_LEN * 2, "%s%s%s", pTfsDir->dirName, TD_DIRSEP, name); snprintf(bname, TMPNAME_LEN * 2, "%s%s%s", pTfsDir->dirName, TD_DIRSEP, name);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册