未验证 提交 94d45c39 编写于 作者: sangshuduo's avatar sangshuduo 提交者: GitHub

[TD-3197]<fix>: taosdemo and taosdump coverity scan issues. (#6207)

Co-authored-by: NShuduo Sang <sdsang@taosdata.com>
上级 5f552855
......@@ -1114,21 +1114,21 @@ static int queryDbExec(TAOS *taos, char *command, QUERY_TYPE type, bool quiet) {
static void appendResultBufToFile(char *resultBuf, char *resultFile)
{
FILE *fp = NULL;
if (resultFile[0] != 0) {
fp = fopen(resultFile, "at");
if (fp == NULL) {
errorPrint(
"%s() LN%d, failed to open result file: %s, result will not save to file\n",
__func__, __LINE__, resultFile);
return;
FILE *fp = NULL;
if (resultFile[0] != 0) {
fp = fopen(resultFile, "at");
if (fp == NULL) {
errorPrint(
"%s() LN%d, failed to open result file: %s, result will not save to file\n",
__func__, __LINE__, resultFile);
return;
}
fprintf(fp, "%s", resultBuf);
tmfclose(fp);
}
}
fprintf(fp, "%s", resultBuf);
tmfclose(fp);
}
static void appendResultToFile(TAOS_RES *res, char* resultFile) {
TAOS_ROW row = NULL;
int num_rows = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册