Skip to content

Commit

Permalink
v1.5b
Browse files Browse the repository at this point in the history
  • Loading branch information
DinoHaw committed Dec 2, 2023
1 parent 92e7705 commit 6842eb2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# keil-build-viewer v1.5a
# keil-build-viewer v1.5b

![演示界面](images/main.png)

Expand Down Expand Up @@ -132,6 +132,7 @@
| v1.4 | 2023-11-21 | Dino | 1. 增加将本工具放置于系统环境变量 Path 所含目录的功能 |
| v1.5 | 2023-11-30 | Dino | 1. 新增更多的 progress bar 样式<br>2. 新增解析自定义的 memory area<br>3. 修复 RAM 和 ROM 信息缺失时显示异常的问题 |
| v1.5a | 2023-11-30 | Dino | 1. 修复 object 数据溢出的问题<br>2. 修改进度条内存大小的显示策略,不再四舍五入 |
| v1.5b | 2023-12-02 | Dino | 1. 修复保存文件路径内存动态分配过小的问题 |
## 参与贡献
Expand Down
16 changes: 12 additions & 4 deletions keil-build-viewer.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* This file is keil-build-viewer.
*
* Author: Dino Haw <[email protected]>
* Version: v1.5a
* Version: v1.5b
* Change Logs:
* Version Date Author Notes
* v1.0 2023-11-10 Dino the first version
Expand All @@ -44,6 +44,7 @@
* 3. 修复 RAM 和 ROM 信息缺失时显示异常的问题
* v1.5a 2023-11-30 Dino 1. 修复 object 数据溢出的问题
* 2. 修改进度条内存大小的显示策略,不再四舍五入
* v1.5b 2023-12-02 Dino 1. 修复保存文件路径内存动态分配过小的问题
*/

/* Includes ------------------------------------------------------------------*/
Expand Down Expand Up @@ -158,7 +159,13 @@ int main(int argc, char *argv[])

/* 创建 log 文件 */
char *file_path = NULL;
size_t file_path_size = buff_len * 2;
size_t file_path_size = 0;

if (buff_len < MAX_PATH) {
file_path_size = MAX_PATH * 2;
} else {
file_path_size = buff_len * 2;
}
file_path = (char *)malloc(file_path_size);
if (file_path == NULL)
{
Expand Down Expand Up @@ -2795,8 +2802,9 @@ void search_files_by_extension(const char *dir,
char *str = strrchr(find_data.cFileName, '.');
if (str && is_same_string(str, extension, extension_qty))
{
char *file_path = malloc(dir_len * 2);
snprintf(file_path, dir_len * 2, "%s\\%s", dir, find_data.cFileName);
size_t len = dir_len + strnlen_s(find_data.cFileName, MAX_PATH) + 2;
char *file_path = malloc(len);
snprintf(file_path, len, "%s\\%s", dir, find_data.cFileName);
prj_path_list_add(list, file_path);
}
}
Expand Down
2 changes: 1 addition & 1 deletion keil-build-viewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <windows.h>

#define APP_NAME "keil-build-viewer"
#define APP_VERSION "v1.5a"
#define APP_VERSION "v1.5b"

#define MAX_DIR_HIERARCHY 32 /* 最大目录层级 */
#define MAX_PATH_QTY 32 /* 最大目录数量 */
Expand Down

0 comments on commit 6842eb2

Please sign in to comment.