fix: scanf set length from 128 to 255

This commit is contained in:
Alex Duan 2025-03-10 11:54:18 +08:00
parent 4daa71b6be
commit 6c25d88f14
2 changed files with 4 additions and 4 deletions

View File

@ -226,13 +226,13 @@ class TDTestCase(TBase):
tdSql.execute(sql)
cmds = [
f"-udkj -p{pwd} -s show databases;", # command pass
f"-udkj -p < {pwdFile} -s show databases;" # input pass
f"-udkj -p{pwd} -s 'show databases;'", # command pass
f"-udkj -p < {pwdFile} -s 'show databases;'" # input pass
]
for cmd in cmds:
rlist = self.taos(cmd)
self.checkListString("Query OK,")
self.checkListString(rlist, "Query OK,")
# run
def run(self):

View File

@ -337,7 +337,7 @@ static void shellInitArgs(int argc, char *argv[]) {
if (strlen(argv[i]) == 2) {
printf("Enter password: ");
taosSetConsoleEcho(false);
if (scanf("%128s", shell.args.password) > 1) {
if (scanf("%255s", shell.args.password) > 1) {
fprintf(stderr, "password reading error\n");
}
taosSetConsoleEcho(true);