mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/tusb_console_strlen' into 'master'
Fix a strncpy-related warning caused by a wrong argument See merge request espressif/esp-idf!10685
This commit is contained in:
commit
b1ace5808d
@ -83,11 +83,11 @@ static esp_err_t apply_path(char const *path)
|
||||
ESP_LOGE(TAG, "The path is too long; maximum is %d characters", VFS_TUSB_MAX_PATH);
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
strncpy(s_vfstusb.vfs_path, path, path_len);
|
||||
strncpy(s_vfstusb.vfs_path, path, (VFS_TUSB_MAX_PATH - 1));
|
||||
} else {
|
||||
strncpy(s_vfstusb.vfs_path,
|
||||
VFS_TUSB_PATH_DEFAULT,
|
||||
strlen(VFS_TUSB_PATH_DEFAULT) + 1);
|
||||
(VFS_TUSB_MAX_PATH - 1));
|
||||
}
|
||||
ESP_LOGV(TAG, "Path is set to `%s`", s_vfstusb.vfs_path);
|
||||
return ESP_OK;
|
||||
|
Loading…
Reference in New Issue
Block a user