fix: cppcheck

This commit is contained in:
luwenpeng
2024-08-12 15:56:09 +08:00
parent e14e8b88e4
commit ea0d743b1a
5 changed files with 29 additions and 9 deletions

View File

@@ -2,6 +2,7 @@
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <arpa/inet.h>
#include "toml.h"
@@ -10,7 +11,6 @@
#include "stellar/session.h"
#include "stellar/stellar_mq.h"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#define LOG_ERR(fmt, ...) printf("ERROR [packet inject] " fmt, ##__VA_ARGS__)
@@ -431,7 +431,10 @@ static void on_sess_free(struct session *sess, void *sess_ctx, void *plugin_ctx)
static void on_sess_msg(struct session *sess, int topic_id, const void *msg, void *sess_ctx, void *plugin_ctx)
{
if(msg==NULL)return;// session closing, return directly
if (msg == NULL)
{
return;
}
char buffer[1024] = {0};
struct packet *pkt = (struct packet *)msg;