From fa8dcb3f9889647c854579193935cf134f9d3a1b Mon Sep 17 00:00:00 2001 From: fengzero Date: Mon, 10 Jul 2023 02:26:37 +0000 Subject: [PATCH] fix cppcheck --- src/connection/connection.c | 2 +- src/connection/smart_link.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/connection/connection.c b/src/connection/connection.c index d5513191..08883974 100644 --- a/src/connection/connection.c +++ b/src/connection/connection.c @@ -857,7 +857,7 @@ static void conn_connect(neu_conn_t *conn) struct termios tty_opt = { 0 }; #ifdef NEU_SMART_LINK #include "connection/neu_smart_link.h" - int ret = + ret = neu_conn_smart_link_auto_set(conn->param.params.tty_client.device); zlog_notice(conn->param.log, "smart link ret: %d", ret); if (ret > 0) { diff --git a/src/connection/smart_link.c b/src/connection/smart_link.c index 098e8bcc..3a6359a6 100644 --- a/src/connection/smart_link.c +++ b/src/connection/smart_link.c @@ -68,7 +68,7 @@ static int read_file(const char *path, char **buf) rewind(fp); *buf = calloc(1, size + 1); - if (buf == NULL) { + if (*buf == NULL) { fclose(fp); return -1; }