shell32/tests: Don't use strncat with known large enough buffer.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2018-08-15 07:08:50 +02:00
parent 9b94096448
commit 3386c01349
1 changed files with 5 additions and 5 deletions

View File

@ -44,8 +44,8 @@ static int get_number_of_folders(LPCSTR path)
WIN32_FIND_DATAA find_data; WIN32_FIND_DATAA find_data;
HANDLE find_handle; HANDLE find_handle;
lstrcpynA(path_search_string, path, MAX_PATH); lstrcpynA(path_search_string, path, MAX_PATH - 1);
strncat(path_search_string, "*", 1); strcat(path_search_string, "*");
find_handle = FindFirstFileA(path_search_string, &find_data); find_handle = FindFirstFileA(path_search_string, &find_data);
if (find_handle == INVALID_HANDLE_VALUE) if (find_handle == INVALID_HANDLE_VALUE)
@ -186,9 +186,9 @@ static void test_click_make_new_folder_button(void)
{ {
skip("GetCurrentDirectoryA failed %u\n", GetLastError()); skip("GetCurrentDirectoryA failed %u\n", GetLastError());
} }
strncat(test_folder_path, "\\", 1); strcat(test_folder_path, "\\");
strncat(test_folder_path, title, MAX_PATH-1); strcat(test_folder_path, title);
strncat(test_folder_path, "\\", 1); strcat(test_folder_path, "\\");
/* Avoid conflicts by creating a test folder. */ /* Avoid conflicts by creating a test folder. */
if (!CreateDirectoryA(title, NULL)) if (!CreateDirectoryA(title, NULL))