提交 2a623947 编写于 作者: H hjliao

fix bug #568

上级 76fa085f
......@@ -58,7 +58,7 @@ int32_t tSQLParse(SSqlInfo *pSQLInfo, const char *pStr) {
goto abort_parse;
}
case TK_ILLEGAL: {
sprintf(pSQLInfo->pzErrMsg, "unrecognized token: \"%s\"", t0.z);
snprintf(pSQLInfo->pzErrMsg, tListLen(pSQLInfo->pzErrMsg), "unrecognized token: \"%s\"", t0.z);
pSQLInfo->validSql = false;
goto abort_parse;
}
......
......@@ -631,7 +631,7 @@ char *taos_errstr(TAOS *taos) {
code = pObj->pSql->res.code;
if (code == TSDB_CODE_INVALID_SQL) {
sprintf(temp, "invalid SQL: %s", pObj->pSql->cmd.payload);
snprintf(temp, tListLen(temp), "invalid SQL: %s", pObj->pSql->cmd.payload);
strcpy(pObj->pSql->cmd.payload, temp);
return pObj->pSql->cmd.payload;
} else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册