diff --git a/meshcore/meshinfo.c b/meshcore/meshinfo.c index adf8bb2..f2694cb 100644 --- a/meshcore/meshinfo.c +++ b/meshcore/meshinfo.c @@ -467,25 +467,25 @@ int info_GetLocalInterfaces(char* data, int maxdata) int MeshInfo_GetSystemInformation(char** data) { int ptr = 0; + int r; // Setup the response if ((*data = (char*)malloc(65536)) == NULL) { ILIBCRITICALEXIT(254); } ptr += sprintf_s(*data + ptr, 65536 - ptr, "{\"netif\":["); - ptr += info_GetLocalInterfaces(*data + ptr, 65536 - ptr); - ptr += sprintf_s(*data + ptr, 65536 - ptr, "]}"); - if (ptr < 65535) + ptr += (r = info_GetLocalInterfaces(*data + ptr, 65536 - ptr)); + if ((ptr += sprintf_s(*data + ptr, 65536 - ptr, "]}")) < 0 || r == 0) + { + free(*data); + *data = NULL; + return(0); + } + else { (*data)[ptr] = 0; if ((*data = realloc(*data, ptr + 1)) == NULL) { ILIBCRITICALEXIT(254); } return ptr; } - else - { - free(*data); - *data = NULL; - return(0); - } } diff --git a/microstack/ILibAsyncSocket.c b/microstack/ILibAsyncSocket.c index 2f4c9b6..658ee02 100644 --- a/microstack/ILibAsyncSocket.c +++ b/microstack/ILibAsyncSocket.c @@ -182,7 +182,7 @@ typedef struct ILibAsyncSocketModule struct ILibAsyncSocket_SendData *PendingSend_Head; struct ILibAsyncSocket_SendData *PendingSend_Tail; - sem_t SendLock; + ILibSpinLock SendLock; int MaxBufferSize; int MaxBufferSizeExceeded; diff --git a/microstack/ILibParsers.c b/microstack/ILibParsers.c index 3cb1a2d..b81f8af 100644 --- a/microstack/ILibParsers.c +++ b/microstack/ILibParsers.c @@ -3628,8 +3628,6 @@ void ILibChain_PartialStart(void *Chain) { if (Chain == NULL) { return; } ILibBaseChain *chain = (ILibBaseChain*)Chain; - ILibChain_Link *module; - ILibChain_Link_Hook *nodeHook; #ifdef WIN32 memset(chain->WaitHandles, 0, sizeof(chain->WaitHandles));