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; }