diff --git a/winpr/libwinpr/clipboard/clipboard.c b/winpr/libwinpr/clipboard/clipboard.c index 0817b408f..fbba8f7d5 100644 --- a/winpr/libwinpr/clipboard/clipboard.c +++ b/winpr/libwinpr/clipboard/clipboard.c @@ -148,7 +148,7 @@ void ClipboardUnlock(wClipboard* clipboard) BOOL ClipboardEmpty(wClipboard* clipboard) { if (!clipboard) - return NULL; + return FALSE; if (clipboard->data) { diff --git a/winpr/libwinpr/thread/thread.c b/winpr/libwinpr/thread/thread.c index 7ff53214d..533fbba9b 100644 --- a/winpr/libwinpr/thread/thread.c +++ b/winpr/libwinpr/thread/thread.c @@ -296,9 +296,9 @@ static void winpr_StartThread(WINPR_THREAD *thread) HANDLE CreateThread(LPSECURITY_ATTRIBUTES lpThreadAttributes, SIZE_T dwStackSize, LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, DWORD dwCreationFlags, LPDWORD lpThreadId) { - int flags; HANDLE handle; WINPR_THREAD* thread; + thread = (WINPR_THREAD*) calloc(1, sizeof(WINPR_THREAD)); if (!thread) @@ -332,8 +332,10 @@ HANDLE CreateThread(LPSECURITY_ATTRIBUTES lpThreadAttributes, SIZE_T dwStackSize return NULL; } - flags = fcntl(thread->pipe_fd[0], F_GETFL); - fcntl(thread->pipe_fd[0], F_SETFL, flags | O_NONBLOCK); + { + int flags = fcntl(thread->pipe_fd[0], F_GETFL); + fcntl(thread->pipe_fd[0], F_SETFL, flags | O_NONBLOCK); + } #endif pthread_mutex_init(&thread->mutex, 0);