Skip to content

Commit 60a5c70

Browse files
committed
Fix warning about discarding const qualifier in MQTTProtocolOut
Signed-off-by: Jan Claußen <jan.claussen10@web.de>
1 parent 59d5127 commit 60a5c70

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/MQTTProtocolOut.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,10 @@ extern ClientStates* bstate;
5656
size_t MQTTProtocol_addressPort(const char* uri, int* port, const char **topic, int default_port)
5757
{
5858
char* buf = (char*)uri;
59-
char* colon_pos;
6059
size_t len;
61-
char* topic_pos;
6260

6361
FUNC_ENTRY;
64-
colon_pos = strrchr(uri, ':'); /* reverse find to allow for ':' in IPv6 addresses */
62+
const char *colon_pos = strrchr(uri, ':'); /* reverse find to allow for ':' in IPv6 addresses */
6563

6664
if (uri[0] == '[')
6765
{ /* ip v6 */
@@ -81,7 +79,7 @@ size_t MQTTProtocol_addressPort(const char* uri, int* port, const char **topic,
8179
}
8280

8381
/* find any topic portion */
84-
topic_pos = (char*)uri;
82+
const char *topic_pos = (char*)uri;
8583
if (colon_pos)
8684
topic_pos = colon_pos;
8785
topic_pos = strchr(topic_pos, '/');

0 commit comments

Comments
 (0)