Commit 8341b51b authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

netapi32/tests: Fix the size passed to GetUserNameW() and GetComputerNameW() (Coverity).

parent 142585a1
...@@ -494,10 +494,10 @@ START_TEST(access) ...@@ -494,10 +494,10 @@ START_TEST(access)
pDavGetHTTPFromUNCPath = (void*)GetProcAddress(hnetapi32, "DavGetHTTPFromUNCPath"); pDavGetHTTPFromUNCPath = (void*)GetProcAddress(hnetapi32, "DavGetHTTPFromUNCPath");
pDavGetUNCFromHTTPPath = (void*)GetProcAddress(hnetapi32, "DavGetUNCFromHTTPPath"); pDavGetUNCFromHTTPPath = (void*)GetProcAddress(hnetapi32, "DavGetUNCFromHTTPPath");
size = sizeof(user_name); size = ARRAY_SIZE(user_name);
ret = GetUserNameW(user_name, &size); ret = GetUserNameW(user_name, &size);
ok(ret, "Failed to get user name, error %u.\n", GetLastError()); ok(ret, "Failed to get user name, error %u.\n", GetLastError());
size = sizeof(computer_name); size = ARRAY_SIZE(computer_name);
ret = GetComputerNameW(computer_name, &size); ret = GetComputerNameW(computer_name, &size);
ok(ret, "Failed to get computer name, error %u.\n", GetLastError()); ok(ret, "Failed to get computer name, error %u.\n", GetLastError());
......
...@@ -175,10 +175,10 @@ START_TEST(wksta) ...@@ -175,10 +175,10 @@ START_TEST(wksta)
pNetpGetComputerName = (void *)GetProcAddress(GetModuleHandleA("netapi32.dll"), "NetpGetComputerName"); pNetpGetComputerName = (void *)GetProcAddress(GetModuleHandleA("netapi32.dll"), "NetpGetComputerName");
size = sizeof(user_name); size = ARRAY_SIZE(user_name);
ret = GetUserNameW(user_name, &size); ret = GetUserNameW(user_name, &size);
ok(ret, "Failed to get user name, error %u.\n", GetLastError()); ok(ret, "Failed to get user name, error %u.\n", GetLastError());
size = sizeof(computer_name); size = ARRAY_SIZE(computer_name);
ret = GetComputerNameW(computer_name, &size); ret = GetComputerNameW(computer_name, &size);
ok(ret, "Failed to get computer name, error %u.\n", GetLastError()); ok(ret, "Failed to get computer name, error %u.\n", GetLastError());
......
Markdown is supported
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