aboutsummaryrefslogtreecommitdiff
path: root/lib/vtls/nss.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2018-05-11 23:40:58 +0200
committerDaniel Stenberg <daniel@haxx.se>2018-05-21 23:21:47 +0200
commitcb529b713f4882ac65a074ae8d87faa41d19168e (patch)
treeb9f23f33a817107127020630c7b9b5764e8685f0 /lib/vtls/nss.c
parentf3d836b73601fc6d14cb917e1cd72f43b9056dff (diff)
checksrc: make sure sizeof() is used *with* parentheses
... and unify the source code to adhere. Closes #2563
Diffstat (limited to 'lib/vtls/nss.c')
-rw-r--r--lib/vtls/nss.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/vtls/nss.c b/lib/vtls/nss.c
index 7cd450cda..89f818397 100644
--- a/lib/vtls/nss.c
+++ b/lib/vtls/nss.c
@@ -394,7 +394,7 @@ static PK11SlotInfo* nss_find_slot_by_name(const char *slot_name)
/* wrap 'ptr' as list node and tail-insert into 'list' */
static CURLcode insert_wrapped_ptr(struct curl_llist *list, void *ptr)
{
- struct ptr_list_wrap *wrap = malloc(sizeof *wrap);
+ struct ptr_list_wrap *wrap = malloc(sizeof(*wrap));
if(!wrap)
return CURLE_OUT_OF_MEMORY;
@@ -914,11 +914,11 @@ static CURLcode display_conn_info(struct connectdata *conn, PRFileDesc *sock)
PRTime now;
int i;
- if(SSL_GetChannelInfo(sock, &channel, sizeof channel) ==
- SECSuccess && channel.length == sizeof channel &&
+ if(SSL_GetChannelInfo(sock, &channel, sizeof(channel)) ==
+ SECSuccess && channel.length == sizeof(channel) &&
channel.cipherSuite) {
if(SSL_GetCipherSuiteInfo(channel.cipherSuite,
- &suite, sizeof suite) == SECSuccess) {
+ &suite, sizeof(suite)) == SECSuccess) {
infof(conn->data, "SSL connection using %s\n", suite.cipherSuiteName);
}
}
@@ -1345,7 +1345,8 @@ static CURLcode nss_init(struct Curl_easy *data)
return CURLE_OUT_OF_MEMORY;
/* the default methods just call down to the lower I/O layer */
- memcpy(&nspr_io_methods, PR_GetDefaultIOMethods(), sizeof nspr_io_methods);
+ memcpy(&nspr_io_methods, PR_GetDefaultIOMethods(),
+ sizeof(nspr_io_methods));
/* override certain methods in the table by our wrappers */
nspr_io_methods.recv = nspr_io_recv;