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:
Shengliang Guan 2020-09-10 20:12:09 +08:00 committed by GitHub
commit 7b02680720
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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");

View File

@ -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;