mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-14 00:14:11 +09:00
winpr: fixes and cleanup
Integrated notes and issues for the pending pull request * wf_info: * cleanup: remove unnecessary breaks * fix typo * change usage of calloc * print.c: fix incorrect check * makecert.c: cleanup includes
This commit is contained in:
@@ -48,16 +48,13 @@ int wf_info_lock(wfInfo* wfi)
|
||||
case WAIT_ABANDONED:
|
||||
case WAIT_OBJECT_0:
|
||||
return TRUE;
|
||||
break;
|
||||
|
||||
case WAIT_TIMEOUT:
|
||||
return FALSE;
|
||||
break;
|
||||
|
||||
case WAIT_FAILED:
|
||||
WLog_ERR(TAG, "wf_info_lock failed with 0x%08X", GetLastError());
|
||||
return -1;
|
||||
break;
|
||||
}
|
||||
|
||||
return -1;
|
||||
@@ -74,16 +71,13 @@ int wf_info_try_lock(wfInfo* wfi, DWORD dwMilliseconds)
|
||||
case WAIT_ABANDONED:
|
||||
case WAIT_OBJECT_0:
|
||||
return TRUE;
|
||||
break;
|
||||
|
||||
case WAIT_TIMEOUT:
|
||||
return FALSE;
|
||||
break;
|
||||
|
||||
case WAIT_FAILED:
|
||||
WLog_ERR(TAG, "wf_info_try_lock failed with 0x%08X", GetLastError());
|
||||
return -1;
|
||||
break;
|
||||
}
|
||||
|
||||
return -1;
|
||||
@@ -143,7 +137,7 @@ wfInfo* wf_info_init()
|
||||
return NULL;
|
||||
}
|
||||
|
||||
wfi->peers = (freerdp_peer**) calloc(1, sizeof(freerdp_peer*) * WF_INFO_MAXPEERS);
|
||||
wfi->peers = (freerdp_peer**) calloc(WF_INFO_MAXPEERS, sizeof(freerdp_peer*));
|
||||
if (!wfi->peers)
|
||||
{
|
||||
WLog_ERR(TAG, "Failed to allocate memory for peer");
|
||||
@@ -222,7 +216,7 @@ void wf_info_peer_register(wfInfo* wfi, wfPeerContext* context)
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
//look trhough the array of peers until an empty slot
|
||||
//look through the array of peers until an empty slot
|
||||
for(i=0; i<WF_INFO_MAXPEERS; ++i)
|
||||
{
|
||||
//empty index will be our peer id
|
||||
|
||||
@@ -117,7 +117,7 @@ char* winpr_BinToHexString(const BYTE* data, int length, BOOL space)
|
||||
char bin2hex[] = "0123456789ABCDEF";
|
||||
n = space ? 3 : 2;
|
||||
p = (char*) malloc((length + 1) * n);
|
||||
if (p)
|
||||
if (!p)
|
||||
return NULL;
|
||||
|
||||
for (i = 0; i < length; i++)
|
||||
|
||||
@@ -22,14 +22,12 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <winpr/crt.h>
|
||||
#include <winpr/file.h>
|
||||
#include <winpr/path.h>
|
||||
#include <winpr/cmdline.h>
|
||||
#include <winpr/sysinfo.h>
|
||||
|
||||
#include <openssl/conf.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/pkcs12.h>
|
||||
#include <openssl/x509v3.h>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user