Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
82d774b7
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
82d774b7
编写于
4月 23, 2021
作者:
sangshuduo
提交者:
GitHub
4月 23, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-3914]<fix>: taosdemo input argument validation. (#5899)
Co-authored-by:
N
Shuduo Sang
<
sdsang@taosdata.com
>
上级
3af9b46a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
53 addition
and
0 deletion
+53
-0
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+53
-0
未找到文件。
src/kit/taosdemo/taosdemo.c
浏览文件 @
82d774b7
...
@@ -717,9 +717,19 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
...
@@ -717,9 +717,19 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
if
(
strcmp
(
argv
[
i
],
"-f"
)
==
0
)
{
if
(
strcmp
(
argv
[
i
],
"-f"
)
==
0
)
{
arguments
->
metaFile
=
argv
[
++
i
];
arguments
->
metaFile
=
argv
[
++
i
];
}
else
if
(
strcmp
(
argv
[
i
],
"-c"
)
==
0
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-c"
)
==
0
)
{
if
(
argc
==
i
+
1
)
{
printHelp
();
errorPrint
(
"%s"
,
"
\n\t
-c need a valid path following!
\n
"
);
exit
(
EXIT_FAILURE
);
}
tstrncpy
(
configDir
,
argv
[
++
i
],
MAX_FILE_NAME_LEN
);
tstrncpy
(
configDir
,
argv
[
++
i
],
MAX_FILE_NAME_LEN
);
}
else
if
(
strcmp
(
argv
[
i
],
"-h"
)
==
0
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-h"
)
==
0
)
{
if
(
argc
==
i
+
1
)
{
printHelp
();
errorPrint
(
"%s"
,
"
\n\t
-h need a valid string following!
\n
"
);
exit
(
EXIT_FAILURE
);
}
arguments
->
host
=
argv
[
++
i
];
arguments
->
host
=
argv
[
++
i
];
}
else
if
(
strcmp
(
argv
[
i
],
"-p"
)
==
0
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-p"
)
==
0
)
{
if
((
argc
==
i
+
1
)
||
if
((
argc
==
i
+
1
)
||
...
@@ -730,12 +740,32 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
...
@@ -730,12 +740,32 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
}
}
arguments
->
port
=
atoi
(
argv
[
++
i
]);
arguments
->
port
=
atoi
(
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-u"
)
==
0
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-u"
)
==
0
)
{
if
(
argc
==
i
+
1
)
{
printHelp
();
errorPrint
(
"%s"
,
"
\n\t
-u need a valid string following!
\n
"
);
exit
(
EXIT_FAILURE
);
}
arguments
->
user
=
argv
[
++
i
];
arguments
->
user
=
argv
[
++
i
];
}
else
if
(
strcmp
(
argv
[
i
],
"-P"
)
==
0
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-P"
)
==
0
)
{
if
(
argc
==
i
+
1
)
{
printHelp
();
errorPrint
(
"%s"
,
"
\n\t
-P need a valid string following!
\n
"
);
exit
(
EXIT_FAILURE
);
}
arguments
->
password
=
argv
[
++
i
];
arguments
->
password
=
argv
[
++
i
];
}
else
if
(
strcmp
(
argv
[
i
],
"-o"
)
==
0
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-o"
)
==
0
)
{
if
(
argc
==
i
+
1
)
{
printHelp
();
errorPrint
(
"%s"
,
"
\n\t
-o need a valid string following!
\n
"
);
exit
(
EXIT_FAILURE
);
}
arguments
->
output_file
=
argv
[
++
i
];
arguments
->
output_file
=
argv
[
++
i
];
}
else
if
(
strcmp
(
argv
[
i
],
"-s"
)
==
0
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-s"
)
==
0
)
{
if
(
argc
==
i
+
1
)
{
printHelp
();
errorPrint
(
"%s"
,
"
\n\t
-s need a valid string following!
\n
"
);
exit
(
EXIT_FAILURE
);
}
arguments
->
sqlFile
=
argv
[
++
i
];
arguments
->
sqlFile
=
argv
[
++
i
];
}
else
if
(
strcmp
(
argv
[
i
],
"-q"
)
==
0
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-q"
)
==
0
)
{
if
((
argc
==
i
+
1
)
||
if
((
argc
==
i
+
1
)
||
...
@@ -762,8 +792,20 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
...
@@ -762,8 +792,20 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
}
}
arguments
->
insert_interval
=
atoi
(
argv
[
++
i
]);
arguments
->
insert_interval
=
atoi
(
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-qt"
)
==
0
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-qt"
)
==
0
)
{
if
((
argc
==
i
+
1
)
||
(
!
isStringNumber
(
argv
[
i
+
1
])))
{
printHelp
();
errorPrint
(
"%s"
,
"
\n\t
-qt need a number following!
\n
"
);
exit
(
EXIT_FAILURE
);
}
arguments
->
query_times
=
atoi
(
argv
[
++
i
]);
arguments
->
query_times
=
atoi
(
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-B"
)
==
0
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-B"
)
==
0
)
{
if
((
argc
==
i
+
1
)
||
(
!
isStringNumber
(
argv
[
i
+
1
])))
{
printHelp
();
errorPrint
(
"%s"
,
"
\n\t
-B need a number following!
\n
"
);
exit
(
EXIT_FAILURE
);
}
arguments
->
interlace_rows
=
atoi
(
argv
[
++
i
]);
arguments
->
interlace_rows
=
atoi
(
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-r"
)
==
0
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-r"
)
==
0
)
{
if
((
argc
==
i
+
1
)
||
if
((
argc
==
i
+
1
)
||
...
@@ -790,6 +832,11 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
...
@@ -790,6 +832,11 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
}
}
arguments
->
num_of_DPT
=
atoi
(
argv
[
++
i
]);
arguments
->
num_of_DPT
=
atoi
(
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-d"
)
==
0
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-d"
)
==
0
)
{
if
(
argc
==
i
+
1
)
{
printHelp
();
errorPrint
(
"%s"
,
"
\n\t
-d need a valid string following!
\n
"
);
exit
(
EXIT_FAILURE
);
}
arguments
->
database
=
argv
[
++
i
];
arguments
->
database
=
argv
[
++
i
];
}
else
if
(
strcmp
(
argv
[
i
],
"-l"
)
==
0
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-l"
)
==
0
)
{
if
((
argc
==
i
+
1
)
||
if
((
argc
==
i
+
1
)
||
...
@@ -855,6 +902,12 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
...
@@ -855,6 +902,12 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
}
}
arguments
->
len_of_binary
=
atoi
(
argv
[
++
i
]);
arguments
->
len_of_binary
=
atoi
(
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-m"
)
==
0
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-m"
)
==
0
)
{
if
((
argc
==
i
+
1
)
||
(
!
isStringNumber
(
argv
[
i
+
1
])))
{
printHelp
();
errorPrint
(
"%s"
,
"
\n\t
-m need a number following!
\n
"
);
exit
(
EXIT_FAILURE
);
}
arguments
->
tb_prefix
=
argv
[
++
i
];
arguments
->
tb_prefix
=
argv
[
++
i
];
}
else
if
(
strcmp
(
argv
[
i
],
"-N"
)
==
0
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-N"
)
==
0
)
{
arguments
->
use_metric
=
false
;
arguments
->
use_metric
=
false
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录