mirror of
https://github.com/lvgl/lvgl.git
synced 2026-06-02 01:18:04 +08:00
fix(sprintf): fix sprintf compile errors (#5358)
This commit is contained in:
@@ -283,7 +283,7 @@ static lv_fs_res_t fs_dir_read(lv_fs_drv_t * drv, void * dir_p, char * fn)
|
||||
do {
|
||||
entry = readdir(dir_p);
|
||||
if(entry) {
|
||||
if(entry->d_type == DT_DIR) sprintf(fn, "/%s", entry->d_name);
|
||||
if(entry->d_type == DT_DIR) lv_snprintf(fn, lv_strlen(entry->d_name) + 2, "/%s", entry->d_name);
|
||||
else lv_strcpy(fn, entry->d_name);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -283,7 +283,7 @@ static lv_fs_res_t fs_dir_read(lv_fs_drv_t * drv, void * dir_p, char * fn)
|
||||
entry = readdir(handle->dir_p);
|
||||
if(entry) {
|
||||
/*Note, DT_DIR is not defined in C99*/
|
||||
if(entry->d_type == DT_DIR) snprintf(fn, strlen(entry->d_name), "/%s", entry->d_name);
|
||||
if(entry->d_type == DT_DIR) lv_snprintf(fn, lv_strlen(entry->d_name) + 2, "/%s", entry->d_name);
|
||||
else lv_strcpy(fn, entry->d_name);
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user