mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 01:33:33 +08:00
Renamed shadowed variable
This commit is contained in:
committed by
Lorenz Meier
parent
7b7da618b8
commit
8d66e1c0ef
@@ -1050,15 +1050,15 @@ void UavcanServers::unpackFwFromROMFS(const char* sd_path, const char* romfs_pat
|
|||||||
*/
|
*/
|
||||||
copy_fw = false;
|
copy_fw = false;
|
||||||
} else if (!memcmp(fw_dirent->d_name, UAVCAN_ROMFS_FW_PREFIX, sizeof(UAVCAN_ROMFS_FW_PREFIX) - 1)) {
|
} else if (!memcmp(fw_dirent->d_name, UAVCAN_ROMFS_FW_PREFIX, sizeof(UAVCAN_ROMFS_FW_PREFIX) - 1)) {
|
||||||
size_t fw_len = strlen(fw_dirent->d_name);
|
size_t dst_fw_len = strlen(fw_dirent->d_name);
|
||||||
size_t dstpath_fw_len = dstpath_ver_len + fw_len;
|
size_t dstpath_fw_len = dstpath_ver_len + dst_fw_len;
|
||||||
if (dstpath_fw_len > maxlen) {
|
if (dstpath_fw_len > maxlen) {
|
||||||
// sizeof(prefix) includes trailing NUL, cancelling out the +1 for the path separator
|
// sizeof(prefix) includes trailing NUL, cancelling out the +1 for the path separator
|
||||||
warnx("unlink: path '%s/%s' too long", dstpath, fw_dirent->d_name);
|
warnx("unlink: path '%s/%s' too long", dstpath, fw_dirent->d_name);
|
||||||
} else {
|
} else {
|
||||||
// File name starts with "_", delete it.
|
// File name starts with "_", delete it.
|
||||||
dstpath[dstpath_ver_len] = '/';
|
dstpath[dstpath_ver_len] = '/';
|
||||||
memcpy(&dstpath[dstpath_ver_len + 1], fw_dirent->d_name, fw_len + 1);
|
memcpy(&dstpath[dstpath_ver_len + 1], fw_dirent->d_name, dst_fw_len + 1);
|
||||||
unlink(dstpath);
|
unlink(dstpath);
|
||||||
warnx("unlink: removed '%s'", dstpath);
|
warnx("unlink: removed '%s'", dstpath);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user