Fixed clipboard 'called with invalid type' warning
authorakallabeth <akallabeth@posteo.net>
Mon, 20 Apr 2020 14:02:02 +0000 (16:02 +0200)
committerakallabeth <akallabeth@posteo.net>
Tue, 5 May 2020 05:46:10 +0000 (07:46 +0200)
channels/cliprdr/client/cliprdr_format.c
client/Android/android_cliprdr.c
client/Mac/Clipboard.m
client/Wayland/wlf_cliprdr.c
client/Windows/wf_cliprdr.c
client/X11/xf_cliprdr.c
server/proxy/pf_cliprdr.c

index e2ab39a..43b967e 100644 (file)
@@ -43,7 +43,7 @@
 UINT cliprdr_process_format_list(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen,
                                  UINT16 msgFlags)
 {
-       CLIPRDR_FORMAT_LIST formatList;
+       CLIPRDR_FORMAT_LIST formatList = { 0 };
        CliprdrClientContext* context = cliprdr_get_client_interface(cliprdr);
        UINT error = CHANNEL_RC_OK;
 
@@ -82,7 +82,7 @@ error_out:
 UINT cliprdr_process_format_list_response(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen,
                                           UINT16 msgFlags)
 {
-       CLIPRDR_FORMAT_LIST_RESPONSE formatListResponse;
+       CLIPRDR_FORMAT_LIST_RESPONSE formatListResponse = { 0 };
        CliprdrClientContext* context = cliprdr_get_client_interface(cliprdr);
        UINT error = CHANNEL_RC_OK;
 
index 5e9f791..414a25d 100644 (file)
@@ -81,6 +81,7 @@ UINT android_cliprdr_send_client_format_list(CliprdrClientContext* cliprdr)
        formatList.msgFlags = CB_RESPONSE_OK;
        formatList.numFormats = numFormats;
        formatList.formats = formats;
+       formatList.msgType = CB_FORMAT_LIST;
 
        if (!afc->cliprdr->ClientFormatList)
                goto fail;
index a34e5a8..a57725f 100644 (file)
@@ -28,7 +28,7 @@ int mac_cliprdr_send_client_format_list(CliprdrClientContext *cliprdr)
        UINT32 *pFormatIds;
        const char *formatName;
        CLIPRDR_FORMAT *formats;
-       CLIPRDR_FORMAT_LIST formatList;
+       CLIPRDR_FORMAT_LIST formatList = { 0 };
        mfContext *mfc = (mfContext *)cliprdr->custom;
 
        ZeroMemory(&formatList, sizeof(CLIPRDR_FORMAT_LIST));
@@ -56,6 +56,7 @@ int mac_cliprdr_send_client_format_list(CliprdrClientContext *cliprdr)
        formatList.msgFlags = CB_RESPONSE_OK;
        formatList.numFormats = numFormats;
        formatList.formats = formats;
+       formatList.msgType = CB_FORMAT_LIST;
 
        mfc->cliprdr->ClientFormatList(mfc->cliprdr, &formatList);
 
index 7e11ec1..dff5998 100644 (file)
@@ -174,6 +174,7 @@ static UINT wlf_cliprdr_send_client_format_list(wfClipboard* clipboard)
        formatList.msgFlags = CB_RESPONSE_OK;
        formatList.numFormats = (UINT32)clipboard->numClientFormats;
        formatList.formats = clipboard->clientFormats;
+       formatList.msgType = CB_FORMAT_LIST;
        return clipboard->context->ClientFormatList(clipboard->context, &formatList);
 }
 
index b930f08..18a5cd2 100644 (file)
@@ -1235,7 +1235,7 @@ static UINT cliprdr_send_format_list(wfClipboard* clipboard)
        UINT32 formatId = 0;
        char formatName[1024];
        CLIPRDR_FORMAT* formats = NULL;
-       CLIPRDR_FORMAT_LIST formatList;
+       CLIPRDR_FORMAT_LIST formatList = { 0 };
 
        if (!clipboard)
                return ERROR_INTERNAL_ERROR;
@@ -1287,6 +1287,7 @@ static UINT cliprdr_send_format_list(wfClipboard* clipboard)
 
        formatList.numFormats = numFormats;
        formatList.formats = formats;
+       formatList.msgType = CB_FORMAT_LIST;
        rc = clipboard->context->ClientFormatList(clipboard->context, &formatList);
 
        for (index = 0; index < numFormats; index++)
index abcae72..21017db 100644 (file)
@@ -533,6 +533,7 @@ static void xf_cliprdr_get_requested_targets(xfClipboard* clipboard)
        formatList.msgFlags = CB_RESPONSE_OK;
        formatList.numFormats = numFormats;
        formatList.formats = formats;
+       formatList.msgType = CB_FORMAT_LIST;
        clipboard->context->ClientFormatList(clipboard->context, &formatList);
        xf_cliprdr_free_formats(formats, numFormats);
 }
@@ -1100,6 +1101,7 @@ static UINT xf_cliprdr_send_client_format_list(xfClipboard* clipboard)
        formatList.msgFlags = CB_RESPONSE_OK;
        formatList.numFormats = numFormats;
        formatList.formats = formats;
+       formatList.msgType = CB_FORMAT_LIST;
        ret = clipboard->context->ClientFormatList(clipboard->context, &formatList);
        free(formats);
 
index d5954ca..b490419 100644 (file)
@@ -294,7 +294,7 @@ static UINT pf_cliprdr_ServerFormatList(CliprdrClientContext* context,
 
        if (pdata->config->TextOnly)
        {
-               CLIPRDR_FORMAT_LIST list;
+               CLIPRDR_FORMAT_LIST list = { 0 };
                pf_cliprdr_create_text_only_format_list(&list);
                return server->ServerFormatList(server, &list);
        }