mqtt_msg: avoid uncasting const to mqtt topic and data pointers

This commit is contained in:
David Cermak
2019-05-06 09:37:50 +02:00
parent db71c753aa
commit 60cdb79a67
3 changed files with 10 additions and 10 deletions

View File

@@ -206,7 +206,7 @@ bool mqtt_header_complete(uint8_t* buffer, uint16_t buffer_length)
return buffer_length >= i;
}
const char* mqtt_get_publish_topic(uint8_t* buffer, uint32_t* length)
char* mqtt_get_publish_topic(uint8_t* buffer, uint32_t* length)
{
int i;
int totlen = 0;
@@ -232,10 +232,10 @@ const char* mqtt_get_publish_topic(uint8_t* buffer, uint32_t* length)
return NULL;
*length = topiclen;
return (const char*)(buffer + i);
return (char*)(buffer + i);
}
const char* mqtt_get_publish_data(uint8_t* buffer, uint32_t* length)
char* mqtt_get_publish_data(uint8_t* buffer, uint32_t* length)
{
int i;
int totlen = 0;
@@ -278,7 +278,7 @@ const char* mqtt_get_publish_data(uint8_t* buffer, uint32_t* length)
*length = totlen - i;
else
*length = blength - i;
return (const char*)(buffer + i);
return (char*)(buffer + i);
}
uint16_t mqtt_get_id(uint8_t* buffer, uint16_t length)