Browse Source

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
Matt Clarkson 10 years ago
parent
commit
175c0ce9dd
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/civetweb.c

+ 1 - 1
src/civetweb.c

@@ -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) {