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

Hotfix/sangshuduo/td 3914 taosdemo func param segfault for develop (#6110)

* [TD-3914]<fix>: taosdemo check func param input more.

for develop branch.

* [TD-3914]<fix>: taosdemo check func param more.

for develop branch.

* [TD-3914]<fix>: taosdemo input argument validation. (#6097)
Co-authored-by: NShuduo Sang <sdsang@taosdata.com>
Co-authored-by: NShuduo Sang <sdsang@taosdata.com>
上级 8f8cf26c
...@@ -725,7 +725,6 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) { ...@@ -725,7 +725,6 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
tstrncpy(configDir, argv[++i], TSDB_FILENAME_LEN); tstrncpy(configDir, argv[++i], TSDB_FILENAME_LEN);
} else if (strcmp(argv[i], "-h") == 0) { } else if (strcmp(argv[i], "-h") == 0) {
if (argc == i+1) { if (argc == i+1) {
printHelp(); printHelp();
...@@ -849,6 +848,11 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) { ...@@ -849,6 +848,11 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
} }
arguments->num_of_CPR = atoi(argv[++i]); arguments->num_of_CPR = atoi(argv[++i]);
} else if (strcmp(argv[i], "-b") == 0) { } else if (strcmp(argv[i], "-b") == 0) {
if (argc == i+1) {
printHelp();
errorPrint("%s", "\n\t-b need valid string following!\n");
exit(EXIT_FAILURE);
}
sptr = arguments->datatype; sptr = arguments->datatype;
++i; ++i;
if (strstr(argv[i], ",") == NULL) { if (strstr(argv[i], ",") == NULL) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册