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:
14:c2052aee81de
Child:
23:7a52009beba1
--- a/MQTTSerializePublish.c	Fri Aug 01 16:58:18 2014 +0000
+++ b/MQTTSerializePublish.c	Fri Aug 01 17:25:52 2014 +0000
@@ -55,7 +55,7 @@
 		MQTTString topicName, unsigned char* payload, int payloadlen)
 {
 	unsigned char *ptr = buf;
-	MQTTHeader header;
+	MQTTHeader header = {0};
 	int rem_len = 0;
 	int rc = 0;
 
@@ -102,7 +102,7 @@
   */
 int MQTTSerialize_ack(unsigned char* buf, int buflen, unsigned char packettype, unsigned char dup, unsigned short packetid)
 {
-	MQTTHeader header;
+	MQTTHeader header = {0};
 	int rc = 0;
 	unsigned char *ptr = buf;