1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-11-21 14:00:51 +03:00

Fixed formatting in agent.c

Quiet linter around a couple if blocks and pointer.
This commit is contained in:
Will Cosgrove
2019-04-11 12:08:43 -07:00
committed by GitHub
parent 9ea7d3bced
commit 12343f11da

View File

@@ -150,9 +150,9 @@ agent_connect_unix(LIBSSH2_AGENT *agent)
struct sockaddr_un s_un; struct sockaddr_un s_un;
path = agent->identity_agent_path; path = agent->identity_agent_path;
if (!path) { if(!path) {
path = getenv("SSH_AUTH_SOCK"); path = getenv("SSH_AUTH_SOCK");
if (!path) if(!path)
return _libssh2_error(agent->session, LIBSSH2_ERROR_BAD_USE, return _libssh2_error(agent->session, LIBSSH2_ERROR_BAD_USE,
"no auth sock variable"); "no auth sock variable");
} }
@@ -832,12 +832,12 @@ libssh2_agent_free(LIBSSH2_AGENT *agent)
LIBSSH2_API void LIBSSH2_API void
libssh2_agent_set_identity_path(LIBSSH2_AGENT *agent, const char *path) libssh2_agent_set_identity_path(LIBSSH2_AGENT *agent, const char *path)
{ {
if (agent->identity_agent_path) { if(agent->identity_agent_path) {
LIBSSH2_FREE(agent->session, agent->identity_agent_path); LIBSSH2_FREE(agent->session, agent->identity_agent_path);
agent->identity_agent_path = NULL; agent->identity_agent_path = NULL;
} }
if (path != NULL) { if(path) {
size_t path_len = strlen(path); size_t path_len = strlen(path);
if(path_len < SIZE_MAX - 1) { if(path_len < SIZE_MAX - 1) {
char *path_buf = LIBSSH2_ALLOC(agent->session, path_len + 1); char *path_buf = LIBSSH2_ALLOC(agent->session, path_len + 1);
@@ -854,7 +854,7 @@ libssh2_agent_set_identity_path(LIBSSH2_AGENT *agent, const char *path)
* Returns the custom agent socket path if set * Returns the custom agent socket path if set
* *
*/ */
LIBSSH2_API const char * libssh2_agent_get_identity_path(LIBSSH2_AGENT *agent) LIBSSH2_API const char *libssh2_agent_get_identity_path(LIBSSH2_AGENT *agent)
{ {
return agent->identity_agent_path; return agent->identity_agent_path;
} }