From 27b37eb570de6a0bbb12af91aa4ef9a9a458567d Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Wed, 9 Oct 2024 13:58:41 -0500 Subject: [PATCH] refactor --- .../drives/winfsp/remotewinfsp/remote_winfsp_drive.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/repertory/librepertory/src/drives/winfsp/remotewinfsp/remote_winfsp_drive.cpp b/repertory/librepertory/src/drives/winfsp/remotewinfsp/remote_winfsp_drive.cpp index b39280b9..f38b41e7 100644 --- a/repertory/librepertory/src/drives/winfsp/remotewinfsp/remote_winfsp_drive.cpp +++ b/repertory/librepertory/src/drives/winfsp/remotewinfsp/remote_winfsp_drive.cpp @@ -59,7 +59,7 @@ auto remote_winfsp_drive::winfsp_service::OnStart(ULONG, PWSTR *) -> NTSTATUS { const auto drive_letter = ((mount_location.size() == 2U) || ((mount_location.size() == 3U) && (mount_location.at(2U) == '\\'))) && - (mount_location[1U] == ':'); + (mount_location.at(1U) == ':'); auto ret = drive_letter ? STATUS_DEVICE_BUSY : STATUS_NOT_SUPPORTED; if ((drive_letter && not utils::file::directory(mount_location).exists())) { @@ -119,7 +119,7 @@ auto remote_winfsp_drive::CanDelete(PVOID /*file_node*/, PVOID file_desc, VOID remote_winfsp_drive::Cleanup(PVOID /*file_node*/, PVOID file_desc, PWSTR file_name, ULONG flags) { - BOOLEAN was_closed; + BOOLEAN was_closed{}; remote_instance_->winfsp_cleanup(file_desc, file_name, flags, was_closed); } @@ -295,9 +295,9 @@ auto remote_winfsp_drive::Open(PWSTR file_name, UINT32 create_options, if (ret == STATUS_SUCCESS) { set_file_info(ofi->FileInfo, fi); const auto file_path = utils::string::from_utf8(normalize_name); - wcsncpy(ofi->NormalizedName, &file_path[0], wcslen(&file_path[0])); + wcsncpy(ofi->NormalizedName, file_path.data(), wcslen(file_path.c_str())); ofi->NormalizedNameSize = - static_cast(wcslen(&file_path[0]) * sizeof(WCHAR)); + static_cast(wcslen(file_path.c_str()) * sizeof(WCHAR)); } return ret;