1
0
mirror of https://github.com/lammertb/libhttp.git synced 2025-12-22 04:02:04 +03:00

Set SSL boolean with value rather than int

Shortening an integer to an unsigned char can lead to a situation where the
bottom 8 bits of the integer are all zeroes but the integer is actually
truthy. Using a ternary operator removes the ambiguity and solves compiler
warnings
This commit is contained in:
Matt Clarkson
2015-05-21 15:44:47 +01:00
parent e0948d0d98
commit 175c0ce9dd

View File

@@ -8772,7 +8772,7 @@ struct mg_connection *mg_connect_client(
__func__,
strerror(ERRNO));
}
conn->client.is_ssl = use_ssl;
conn->client.is_ssl = use_ssl ? 1 : 0;
(void)pthread_mutex_init(&conn->mutex, NULL);
#ifndef NO_SSL
if (use_ssl) {