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

[TD-3783]<fix>: taosdemo for windows generates rand string invalid. (#5828)

上级 604c29b0
...@@ -1063,7 +1063,7 @@ static void rand_string(char *str, int size) { ...@@ -1063,7 +1063,7 @@ static void rand_string(char *str, int size) {
//--size; //--size;
int n; int n;
for (n = 0; n < size - 1; n++) { for (n = 0; n < size - 1; n++) {
int key = rand_tinyint() % (int)(sizeof(charset) - 1); int key = abs(rand_tinyint()) % (int)(sizeof(charset) - 1);
str[n] = charset[key]; str[n] = charset[key];
} }
str[n] = 0; str[n] = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册