Merge pull request #3473 from taosdata/hotfix/sangshuduo/fix-issue-getenv-return-unknown-size
[TD-1407] <fix> fix an issue coverity reports
This commit is contained in:
commit
7b02680720
|
@ -786,7 +786,7 @@ void read_history() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void write_history() {
|
void write_history() {
|
||||||
char f_history[128];
|
char f_history[TSDB_FILENAME_LEN];
|
||||||
get_history_path(f_history);
|
get_history_path(f_history);
|
||||||
|
|
||||||
FILE *f = fopen(f_history, "w");
|
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) {
|
void clearScreen(int ecmd_pos, int cursor_pos) {
|
||||||
struct winsize w;
|
struct winsize w;
|
||||||
|
|
Loading…
Reference in New Issue