[vlc-commits] [Git][videolan/vlc][master] contrib: gpg-error: Fix the WCHAR patch to use the right *cpy function

Steve Lhomme (@robUx4) gitlab at videolan.org
Mon Oct 27 20:06:45 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
3f0a3546 by Martin Storsjö at 2025-10-27T19:16:55+00:00
contrib: gpg-error: Fix the WCHAR patch to use the right *cpy function

This fixes build errors with current Clang versions, due to the
mismatched pointers with strcpy.

The previous form of this patch errored out like this:

    ../../src/estream.c:5104:11: error: incompatible pointer
     types passing 'WCHAR *' (aka 'unsigned short *') to parameter of type 'char *' [-Wincompatible-pointer-types]
     5104 |   strcpy (p, "_estream");
          |           ^
    /opt/llvm-mingw/aarch64-w64-mingw32/include/string.h:61:45: note:
     passing argument to parameter '_Dest' here
       61 |   char * __cdecl strcpy(char * __restrict__ _Dest,const char * __restrict__ _Source);
          |                                             ^

- - - - -


2 changed files:

- contrib/src/gpg-error/0004-use-WCHAR-API-for-temporary-windows-folder.patch
- contrib/src/gpg-error/gpg-error-createfile2.patch


Changes:

=====================================
contrib/src/gpg-error/0004-use-WCHAR-API-for-temporary-windows-folder.patch
=====================================
@@ -4,14 +4,14 @@ Date: Thu, 23 Oct 2025 12:17:08 +0200
 Subject: [PATCH 04/12] use WCHAR API for temporary windows folder
 
 ---
- src/estream.c | 12 ++++++------
- 1 file changed, 6 insertions(+), 6 deletions(-)
+ src/estream.c | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
 
 diff --git a/src/estream.c b/src/estream.c
-index 66ebc4b..42027b4 100644
+index 66ebc4b..763e811 100644
 --- a/src/estream.c
 +++ b/src/estream.c
-@@ -5074,15 +5074,15 @@ tmpfd (void)
+@@ -5074,27 +5074,27 @@ tmpfd (void)
  {
  #ifdef HAVE_W32_SYSTEM
    int attempts, n;
@@ -31,7 +31,12 @@ index 66ebc4b..42027b4 100644
    if (!n || n > MAX_PATH || mystrlen (buffer) > MAX_PATH)
      {
        _set_errno (ENOENT);
-@@ -5094,7 +5094,7 @@ tmpfd (void)
+       return -1;
+     }
+   p = buffer + mystrlen (buffer);
+-  strcpy (p, "_estream");
++  wcscpy (p, L"_estream");
+   p += 8;
    /* We try to create the directory but don't care about an error as
       it may already exist and the CreateFile would throw an error
       anyway.  */
@@ -40,11 +45,13 @@ index 66ebc4b..42027b4 100644
    *p++ = '\\';
    name = p;
    for (attempts=0; attempts < 10; attempts++)
-@@ -5107,7 +5107,7 @@ tmpfd (void)
+@@ -5106,8 +5106,8 @@ tmpfd (void)
+           *p++ = tohex (((value >> 28) & 0x0f));
            value <<= 4;
          }
-       strcpy (p, ".tmp");
+-      strcpy (p, ".tmp");
 -      file = CreateFile (buffer,
++      wcscpy (p, L".tmp");
 +      file = CreateFileW (buffer,
                           GENERIC_READ | GENERIC_WRITE,
                           0,


=====================================
contrib/src/gpg-error/gpg-error-createfile2.patch
=====================================
@@ -11,7 +11,7 @@ Subject: [PATCH 05/12] use CreateFile2 in Win8 as CreateFileW is forbidden in
  3 files changed, 46 insertions(+)
 
 diff --git a/src/estream.c b/src/estream.c
-index 42027b4..a99a019 100644
+index 763e811..9fda47e 100644
 --- a/src/estream.c
 +++ b/src/estream.c
 @@ -2030,6 +2030,17 @@ func_file_create_w32 (void **cookie, HANDLE *rethd, const char *path,
@@ -43,7 +43,7 @@ index 42027b4..a99a019 100644
 @@ -5107,6 +5119,17 @@ tmpfd (void)
            value <<= 4;
          }
-       strcpy (p, ".tmp");
+       wcscpy (p, L".tmp");
 +#if _WIN32_WINNT >= 0x0602 // _WIN32_WINNT_WIN8
 +      CREATEFILE2_EXTENDED_PARAMETERS params;
 +      memset (&params, 0, sizeof params);



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/3f0a3546730d5fa97aa257200954a5f0c117a797

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/3f0a3546730d5fa97aa257200954a5f0c117a797
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list