fix bug #568
This commit is contained in:
parent
76fa085ff2
commit
2a623947d1
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue