Skip to content

Commit

Permalink
Fixed compilation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
akallabeth committed Jul 4, 2022
1 parent 9a2a377 commit 2da280b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion channels/ainput/server/ainput_main.c
Expand Up @@ -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;

Expand Down
9 changes: 5 additions & 4 deletions channels/cliprdr/server/cliprdr_main.c
Expand Up @@ -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;
Expand All @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion client/X11/xf_graphics.c
Expand Up @@ -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;
}

Expand Down

0 comments on commit 2da280b

Please sign in to comment.