Basic C library for MQTT packet serialization and deserialization

Dependents:   MQTT MQTT MQTT MQTT ... more

Fork of MQTTPacket by MQTT

This library is part of the EclipseTM Paho project; specifically the embedded client.

A basic MQTT library in C for packet serialization and deserialization

Revision:
17:c5bd28cc139a
Parent:
16:d0b3886ada32
diff -r d0b3886ada32 -r c5bd28cc139a MQTTSubscribeServer.c
--- a/MQTTSubscribeServer.c	Fri Aug 01 16:58:18 2014 +0000
+++ b/MQTTSubscribeServer.c	Fri Aug 01 17:25:52 2014 +0000
@@ -35,7 +35,7 @@
 int MQTTDeserialize_subscribe(unsigned char* dup, unsigned short* packetid, int maxcount, int* count, MQTTString topicFilters[],
 	int requestedQoSs[], unsigned char* buf, int buflen)
 {
-	MQTTHeader header;
+	MQTTHeader header = {0};
 	unsigned char* curdata = buf;
 	unsigned char* enddata = NULL;
 	int rc = -1;
@@ -81,7 +81,7 @@
   */
 int MQTTSerialize_suback(unsigned char* buf, int buflen, unsigned short packetid, int count, int* grantedQoSs)
 {
-	MQTTHeader header;
+	MQTTHeader header = {0};
 	int rc = -1;
 	unsigned char *ptr = buf;
 	int i;