vrclient_x64: Fix source length for ntdll_umbstowcs().

CW-Bug-Id: #23962
This commit is contained in:
Paul Gofman 2024-06-26 19:24:41 -06:00 committed by Arkadiusz Hiler
parent 54378d5357
commit 63e81a1a95

View file

@ -72,7 +72,7 @@ char *vrclient_dos_to_unix_path( const char *src )
char *unix_path; char *unix_path;
uint32_t r; uint32_t r;
r = ntdll_umbstowcs( src, -1, srcW + 4, PATH_MAX - 4 ); r = ntdll_umbstowcs( src, strlen( src ) + 1, srcW + 4, PATH_MAX - 4 );
if (r == 0) unix_path = NULL; if (r == 0) unix_path = NULL;
else else
{ {
@ -182,7 +182,7 @@ static bool convert_path_to_win(std::string &s)
char *unix_path; char *unix_path;
uint32_t sz; uint32_t sz;
sz = ntdll_umbstowcs( s.c_str(), -1, srcW + 4, PATH_MAX - 4 ); sz = ntdll_umbstowcs( s.c_str(), strlen( s.c_str() ) + 1, srcW + 4, PATH_MAX - 4 );
if (!sz) return false; if (!sz) return false;
for (tmp = srcW; *tmp; ++tmp) if (*tmp == '/') *tmp = '\\'; for (tmp = srcW; *tmp; ++tmp) if (*tmp == '/') *tmp = '\\';