未验证 提交 7b026807 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #3473 from taosdata/hotfix/sangshuduo/fix-issue-getenv-return-unknown-size

[TD-1407] <fix> fix an issue coverity reports
......@@ -786,7 +786,7 @@ void read_history() {
}
void write_history() {
char f_history[128];
char f_history[TSDB_FILENAME_LEN];
get_history_path(f_history);
FILE *f = fopen(f_history, "w");
......
......@@ -409,7 +409,7 @@ void set_terminal_mode() {
}
}
void get_history_path(char *history) { sprintf(history, "%s/%s", getenv("HOME"), HISTORY_FILE); }
void get_history_path(char *history) { snprintf(history, TSDB_FILENAME_LEN, "%s/%s", getenv("HOME"), HISTORY_FILE); }
void clearScreen(int ecmd_pos, int cursor_pos) {
struct winsize w;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册