Skip to content

Commit

Permalink
fix: avoid dangling pointers to local storage
Browse files Browse the repository at this point in the history
  • Loading branch information
leha-bot committed May 11, 2024
1 parent 322f7f2 commit 57b7f65
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion helpers/flipchess_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
bool flipchess_has_file(const FlipChessFile file_type, const char* file_name, const bool remove) {
bool ret = false;
const char* path;
char path_buf[FILE_MAX_PATH_LEN] = {0};
if(file_type == FlipChessFileBoard) {
path = FLIPCHESS_BOARD_PATH;
} else {
char path_buf[FILE_MAX_PATH_LEN] = {0};
strcpy(path_buf, FLIPCHESS_APP_BASE_FOLDER); // 22
strcpy(path_buf + strlen(path_buf), "/");
strcpy(path_buf + strlen(path_buf), file_name);
Expand Down

0 comments on commit 57b7f65

Please sign in to comment.