Commit 0c787862 authored by Steve Lhomme's avatar Steve Lhomme
Browse files

fix the volumeName size use

parent 05909b96
Pipeline #5614 passed with stages
in 10 minutes and 38 seconds
......@@ -45,7 +45,7 @@ namespace fs
std::vector<std::tuple<std::string, std::string, bool>> DeviceLister::devices() const
{
wchar_t volumeName[MAX_PATH];
auto handle = FindFirstVolume( volumeName, sizeof(volumeName)/sizeof(volumeName) );
auto handle = FindFirstVolume( volumeName, sizeof(volumeName)/sizeof(volumeName[0]) );
if ( handle == INVALID_HANDLE_VALUE )
{
std::stringstream ss;
......@@ -55,7 +55,7 @@ std::vector<std::tuple<std::string, std::string, bool>> DeviceLister::devices()
std::unique_ptr<typename std::remove_pointer<HANDLE>::type, decltype(&FindVolumeClose)>
uh( handle, &FindVolumeClose );
std::vector<std::tuple<std::string, std::string, bool>> res;
for ( BOOL success = TRUE; ; success = FindNextVolume( handle, volumeName, sizeof( volumeName )/sizeof(volumeName) ) )
for ( BOOL success = TRUE; ; success = FindNextVolume( handle, volumeName, sizeof( volumeName )/sizeof(volumeName[0]) ) )
{
if ( success == FALSE )
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment