Fixed compilation warnings

This commit is contained in:
akallabeth 2022-07-04 14:34:46 +02:00 committed by akallabeth
parent 9a2a37786e
commit 2da280b8a1
3 changed files with 7 additions and 6 deletions

View File

@ -214,7 +214,7 @@ static UINT ainput_server_recv_mouse_event(ainput_server* ainput, wStream* s)
static HANDLE ainput_server_get_channel_handle(ainput_server* ainput)
{
BYTE* buffer = NULL;
void* buffer = NULL;
DWORD BytesReturned = 0;
HANDLE ChannelEvent = NULL;

View File

@ -617,12 +617,13 @@ static UINT cliprdr_server_receive_temporary_directory(CliprdrServerContext* con
cliprdr = (CliprdrServerPrivate*)context->handle;
WINPR_ASSERT(cliprdr);
if (!Stream_CheckAndLogRequiredLength(TAG, s, 260 * sizeof(WCHAR)))
if (!Stream_CheckAndLogRequiredLength(TAG, s,
ARRAYSIZE(cliprdr->temporaryDirectory) * sizeof(WCHAR)))
return CHANNEL_RC_NO_MEMORY;
wszTempDir = (WCHAR*)Stream_Pointer(s);
if (wszTempDir[259] != 0)
if (wszTempDir[ARRAYSIZE(cliprdr->temporaryDirectory) - 1] != 0)
{
WLog_ERR(TAG, "wszTempDir[259] was not 0");
return ERROR_INVALID_DATA;
@ -639,8 +640,8 @@ static UINT cliprdr_server_receive_temporary_directory(CliprdrServerContext* con
length = strnlen(cliprdr->temporaryDirectory, ARRAYSIZE(cliprdr->temporaryDirectory));
if (length >= 260)
length = 259;
if (length >= ARRAYSIZE(cliprdr->temporaryDirectory))
length = ARRAYSIZE(cliprdr->temporaryDirectory) - 1;
CopyMemory(tempDirectory.szTempDir, cliprdr->temporaryDirectory, length);
tempDirectory.szTempDir[length] = '\0';

View File

@ -452,7 +452,7 @@ static BOOL xf_Pointer_New(rdpContext* context, rdpPointer* pointer)
#endif
fail:
WLog_DBG(TAG, "%s: %ld", __func__, rc ? pointer : -1);
WLog_DBG(TAG, "%s: %p", __func__, rc ? pointer : NULL);
return rc;
}