提交 b2e06d1c 编写于 作者: weixin_48148422's avatar weixin_48148422

Minor improvement to 'setErrMsg'

1. code like `char msg[] = "xxxxxx"` unnecessarily copied the string to stack, changed to `const char* msg = "xxxxxx"`.
2. the 2rd argument of `setErrMsg` is changed from `char*` to `const char*`.
3. the 3rd argument of `setErrMsg` is removed as `strncpy` stops copying at the end of source string.
上级 4dcf8d7f
......@@ -348,7 +348,7 @@ int32_t tsParseOneColumnData(SSchema* pSchema, char* value, int valuelen, char*
// todo merge the error msg function with tSQLParser
static void setErrMsg(char* msg, char* sql) {
char msgFormat[] = "near \"%s\" syntax error";
const char* msgFormat = "near \"%s\" syntax error";
const int32_t BACKWARD_CHAR_STEP = 15;
// only extract part of sql string,avoid too long sql string cause stack over flow
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册