diff --git a/srcs/libs/crypto/base64.c b/srcs/libs/crypto/base64.c index 8187991..6675006 100644 --- a/srcs/libs/crypto/base64.c +++ b/srcs/libs/crypto/base64.c @@ -108,8 +108,8 @@ unsigned char *base64_decode(const char *pBase64, unsigned int *pOutSize) { #else EVP_ENCODE_CTX *pCtx = EVP_ENCODE_CTX_new(); #endif - int enSize = 0; - int size = 0; + int enSize = 0; + int size; unsigned char *pDecode = NULL; if (pBase64 == NULL || strlen(pBase64) == 0) { diff --git a/srcs/libs/crypto/symmetric.c b/srcs/libs/crypto/symmetric.c index 95d87d8..d18fb62 100644 --- a/srcs/libs/crypto/symmetric.c +++ b/srcs/libs/crypto/symmetric.c @@ -123,7 +123,7 @@ int symmetric_decrypto(AES_TYPE algorithmType, unsigned char iv[EVP_MAX_IV_LENGTH] = {0}; const EVP_CIPHER *pCipher; - if (!pInBuf || !pOutSize || !pKey || inSize < 0) { + if (!pInBuf || !pOutSize || !pKey || inSize == 0) { return -ERR_INPUT_PARAMS; } @@ -197,7 +197,7 @@ int symmetric_encrypto(AES_TYPE algorithmType, unsigned char iv[EVP_MAX_IV_LENGTH] = {0}; const EVP_CIPHER *pCipher; - if (!pInBuf || !pOutSize || !pKey || inSize < 0) { + if (!pInBuf || !pOutSize || !pKey || inSize == 0) { return -ERR_INPUT_PARAMS; } diff --git a/srcs/libs/hardware/hardware.c b/srcs/libs/hardware/hardware.c index 4e06b18..cafa018 100644 --- a/srcs/libs/hardware/hardware.c +++ b/srcs/libs/hardware/hardware.c @@ -2,7 +2,6 @@ // Created by xajhu on 2021/7/6 0006. // #include -#include #include #include "s2j/s2j.h" diff --git a/srcs/libs/hardware/memory.c b/srcs/libs/hardware/memory.c index 6f86294..a3fdeb3 100644 --- a/srcs/libs/hardware/memory.c +++ b/srcs/libs/hardware/memory.c @@ -7,7 +7,6 @@ #include #include "hardware.h" -#include "task_manager.h" #include "user_errno.h" #include "uthash/uthash.h" #include "misc.h" diff --git a/srcs/libs/mq/mq_data.c b/srcs/libs/mq/mq_data.c index 37e44d4..4b597f3 100644 --- a/srcs/libs/mq/mq_data.c +++ b/srcs/libs/mq/mq_data.c @@ -9,12 +9,15 @@ #include "msg_queue.h" #include "config.h" -#include "misc.h" #include "s2j/s2j.h" -#include "pppoe_info.h" #include "user_errno.h" + +#ifdef LWIP_ON +#include "misc.h" +#include "pppoe_info.h" #include "user_info.h" #include "vxlan_pkg.h" +#endif #define AGENT_CMD_ADDUSER ("add-ywg-pppoe-vcpe") #define AGENT_CMD_REMOVUSER ("remove-ywg-pppoe-vcpe") @@ -309,7 +312,7 @@ static void process_data_msg(void *UNUSED(pDataCh), zmq_msg_t *pMsg) { dzlog_debug("Process: %s\n", pMqMsg->params); decode_add_user_msg(pMqMsg->params, &p); if (p) { -#if LWIP_ON +#ifdef LWIP_ON int m, n; for (m = 0; m < p->infoCount; m++) { PADD_INFO pInfo = &(p->pInfo[m]); @@ -340,7 +343,7 @@ static void process_data_msg(void *UNUSED(pDataCh), zmq_msg_t *pMsg) { decode_remove_user_msg(pMqMsg->params, &p); if (p) { -#if LWIP_ON +#ifdef LWIP_ON int m; for (m = 0; m < p->nCount; m++) { user_info_remove(p->pUsers[m]); diff --git a/srcs/libs/protocol/protocol.c b/srcs/libs/protocol/protocol.c index b0ac0af..dabefb1 100644 --- a/srcs/libs/protocol/protocol.c +++ b/srcs/libs/protocol/protocol.c @@ -24,7 +24,7 @@ typedef struct { const char *proto_decode_context(const char *pString, unsigned int *pVer, unsigned long long *pTm) { cJSON *pMsgCtx; unsigned char *pBase64; - int decodeSize, ret; + int decodeSize; unsigned int outSize = 0; char *pMsgContent = NULL; cJSON *pRoot = cJSON_Parse(pString);