Skip to content

Commit

Permalink
ldap: adapt to conn->port now being an 'int'
Browse files Browse the repository at this point in the history
Remove typecasts. Fix printf() formats.

Follow-up from 764c6bd.
Pointed out by Coverity CID 1507858.

Closes #9281
  • Loading branch information
bagder committed Aug 8, 2022
1 parent 09f1e58 commit ca528d1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/ldap.c
Expand Up @@ -356,7 +356,7 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done)
#ifdef HAVE_LDAP_SSL
#ifdef USE_WIN32_LDAP
/* Win32 LDAP SDK doesn't support insecure mode without CA! */
server = ldap_sslinit(host, (int)conn->port, 1);
server = ldap_sslinit(host, conn->port, 1);
ldap_set_option(server, LDAP_OPT_SSL, LDAP_OPT_ON);
#else
int ldap_option;
Expand Down Expand Up @@ -402,9 +402,9 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done)
result = CURLE_SSL_CERTPROBLEM;
goto quit;
}
server = ldapssl_init(host, (int)conn->port, 1);
server = ldapssl_init(host, conn->port, 1);
if(!server) {
failf(data, "LDAP local: Cannot connect to %s:%ld",
failf(data, "LDAP local: Cannot connect to %s:%u",
conn->host.dispname, conn->port);
result = CURLE_COULDNT_CONNECT;
goto quit;
Expand Down Expand Up @@ -443,9 +443,9 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done)
result = CURLE_SSL_CERTPROBLEM;
goto quit;
}
server = ldap_init(host, (int)conn->port);
server = ldap_init(host, conn->port);
if(!server) {
failf(data, "LDAP local: Cannot connect to %s:%ld",
failf(data, "LDAP local: Cannot connect to %s:%u",
conn->host.dispname, conn->port);
result = CURLE_COULDNT_CONNECT;
goto quit;
Expand Down Expand Up @@ -484,9 +484,9 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done)
goto quit;
}
else {
server = ldap_init(host, (int)conn->port);
server = ldap_init(host, conn->port);
if(!server) {
failf(data, "LDAP local: Cannot connect to %s:%ld",
failf(data, "LDAP local: Cannot connect to %s:%u",
conn->host.dispname, conn->port);
result = CURLE_COULDNT_CONNECT;
goto quit;
Expand Down

0 comments on commit ca528d1

Please sign in to comment.