From 1e9f99e28d62ad91da273dcbb7142798c7a20171 Mon Sep 17 00:00:00 2001 From: Matt Walsh Date: Mon, 15 May 2017 12:58:34 -0700 Subject: [PATCH] fix compiler warning w/ static port strings --- core/src/rtm.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/src/rtm.c b/core/src/rtm.c index 666176f..f4df5f2 100644 --- a/core/src/rtm.c +++ b/core/src/rtm.c @@ -528,15 +528,19 @@ static rtm_status parse_endpoint(rtm_client_t *rtm, const char *endpoint, char * ASSERT_NOT_NULL(path_out); ASSERT_NOT_NULL(use_tls_out); - char *auto_port = NULL; + const char port80[] = "80"; + const char port443[] = "443"; + + const char *auto_port = NULL; + const char *hostname_start = NULL; if (strncmp(endpoint, WS_PREFIX, sizeof(WS_PREFIX) - 1) == 0) { - auto_port = "80"; + auto_port = port80; hostname_start = endpoint + sizeof(WS_PREFIX) - 1; *use_tls_out = NO; } else if (strncmp(endpoint, WSS_PREFIX, sizeof(WSS_PREFIX) - 1) == 0) { - auto_port = "443"; + auto_port = port443; hostname_start = endpoint + sizeof(WSS_PREFIX) - 1; *use_tls_out = YES; } else {