This commit is contained in:
hjliao 2019-09-27 14:30:29 +08:00
parent 76fa085ff2
commit 2a623947d1
2 changed files with 2 additions and 2 deletions

View File

@ -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;
}

View File

@ -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 {