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: Shuduo Sang <sdsang@taosdata.com>

Co-authored-by: Shuduo Sang <sdsang@taosdata.com>
This commit is contained in:
Shuduo Sang 2021-05-13 12:24:45 +08:00 committed by GitHub
parent 8f8cf26ced
commit 78c24ae135
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -725,7 +725,6 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
exit(EXIT_FAILURE);
}
tstrncpy(configDir, argv[++i], TSDB_FILENAME_LEN);
} else if (strcmp(argv[i], "-h") == 0) {
if (argc == i+1) {
printHelp();
@ -849,6 +848,11 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
}
arguments->num_of_CPR = atoi(argv[++i]);
} 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;
++i;
if (strstr(argv[i], ",") == NULL) {