]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
tests: use CreateFileA for char* filenames
authorSteve Lhomme <robux4@ycbcr.xyz>
Wed, 24 May 2023 13:00:04 +0000 (15:00 +0200)
committerMartin Matuška <martin@matuska.de>
Thu, 13 Jul 2023 22:30:42 +0000 (00:30 +0200)
In case the code is compiled with the UNICODE define.

test_utils/test_main.c

index 3250423a14c27a9d53cc46752e91b50d4a7552c8..e4b884ee3c446a267be7f93cecd7eec2cb7a0a71 100644 (file)
@@ -327,7 +327,7 @@ my_GetFileInformationByName(const char *path, BY_HANDLE_FILE_INFORMATION *bhfi)
        int r;
 
        memset(bhfi, 0, sizeof(*bhfi));
-       h = CreateFile(path, FILE_READ_ATTRIBUTES, 0, NULL,
+       h = CreateFileA(path, FILE_READ_ATTRIBUTES, 0, NULL,
                OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
        if (h == INVALID_HANDLE_VALUE)
                return (0);
@@ -1432,7 +1432,7 @@ assertion_file_time(const char *file, int line,
        /* Note: FILE_FLAG_BACKUP_SEMANTICS applies to open
         * a directory file. If not, CreateFile() will fail when
         * the pathname is a directory. */
-       h = CreateFile(pathname, FILE_READ_ATTRIBUTES, 0, NULL,
+       h = CreateFileA(pathname, FILE_READ_ATTRIBUTES, 0, NULL,
            OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
        if (h == INVALID_HANDLE_VALUE) {
                failure_start(file, line, "Can't access %s\n", pathname);