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

fix: cus prompt length lead hang (#20371)

上级 24e039ef
......@@ -83,7 +83,7 @@ typedef struct {
const char *clientVersion;
char cusName[32];
char promptHeader[32];
const char* promptContinue;
char promptContinue[32];
const char* osname;
int32_t promptSize;
char programVersion[256];
......
......@@ -411,7 +411,9 @@ int32_t shellParseArgs(int32_t argc, char *argv[]) {
"Copyright (c) 2022 by %s, all rights reserved.\r\n\r\n";
strcpy(shell.info.cusName, cusName);
sprintf(shell.info.promptHeader, "%s> ", cusPrompt);
shell.info.promptContinue = TAOS_CONSOLE_PROMPT_CONTINUE;
char promptContinueFormat[32] = {0};
sprintf(promptContinueFormat, "%%%zus> ", strlen(cusPrompt));
sprintf(shell.info.promptContinue, promptContinueFormat, " ");
shell.info.promptSize = strlen(shell.info.promptHeader);
snprintf(shell.info.programVersion, sizeof(shell.info.programVersion),
"version: %s compatible_version: %s\ngitinfo: %s\nbuildInfo: %s", version, compatible_version, gitinfo,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册