From 4b0a4aa5d296a1dca31cf0e91a1a8755b4ec9832 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Thu, 2 Feb 2023 08:36:50 +0300 Subject: [PATCH] removed unused code --- client/core/sshclient.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/client/core/sshclient.cpp b/client/core/sshclient.cpp index 89d6ddcb..8c5a9ebc 100644 --- a/client/core/sshclient.cpp +++ b/client/core/sshclient.cpp @@ -29,7 +29,7 @@ namespace libssh { if (m_session == nullptr) { m_session = ssh_new(); - if (m_session == NULL) { + if (m_session == nullptr) { qDebug() << "Failed to create ssh session"; return ErrorCode::InternalError; } @@ -75,7 +75,7 @@ namespace libssh { void Client::disconnectFromHost() { - if (m_session != NULL) { + if (m_session != nullptr) { if (ssh_is_connected(m_session)) { ssh_disconnect(m_session); } @@ -90,7 +90,7 @@ namespace libssh { { m_channel = ssh_channel_new(m_session); - if (m_channel == NULL) { + if (m_channel == nullptr) { return closeChannel(); } @@ -164,7 +164,7 @@ namespace libssh { ErrorCode Client::writeResponse(const QString &data) { - if (m_channel == NULL) { + if (m_channel == nullptr) { qDebug() << "ssh channel not initialized"; return fromLibsshErrorCode(ssh_get_error_code(m_session)); } @@ -179,7 +179,7 @@ namespace libssh { ErrorCode Client::closeChannel() { - if (m_channel != NULL) { + if (m_channel != nullptr) { if (ssh_channel_is_eof(m_channel)) { ssh_channel_send_eof(m_channel); } @@ -197,7 +197,7 @@ namespace libssh { { m_sftpSession = sftp_new(m_session); - if (m_sftpSession == NULL) { + if (m_sftpSession == nullptr) { return closeSftpSession(); } @@ -218,7 +218,7 @@ namespace libssh { file = sftp_open(m_sftpSession, remotePath.c_str(), accessType, S_IRWXU); - if (file == NULL) { + if (file == nullptr) { return closeSftpSession(); } @@ -285,7 +285,7 @@ namespace libssh { ErrorCode Client::closeSftpSession() { auto errorCode = fromLibsshSftpErrorCode(sftp_get_error(m_sftpSession)); - if (m_sftpSession != NULL) { + if (m_sftpSession != nullptr) { sftp_free(m_sftpSession); m_sftpSession = nullptr; }