A small footprint MQTT library

Dependents:   STM32F746_iothub_client_sample_mqtt FXOS8700CQ_To_Azure_IoT f767zi_mqtt FXOS8700CQ_To_Azure_IoT ... more

Revision:
12:30b08cda82fd
Parent:
8:83bb166aba73
Child:
13:3c202001e4ba
--- a/mqtt_codec.c	Fri Jan 13 18:40:50 2017 -0800
+++ b/mqtt_codec.c	Tue Jan 24 15:24:05 2017 -0800
@@ -133,7 +133,8 @@
     }
     else
     {
-        for (size_t index = 0; index < payloadCount && result == 0; index++)
+        size_t index = 0;
+        for (index = 0; index < payloadCount && result == 0; index++)
         {
             // Add the Payload
             size_t offsetLen = BUFFER_length(ctrlPacket);
@@ -170,7 +171,8 @@
     }
     else
     {
-        for (size_t index = 0; index < payloadCount && result == 0; index++)
+        size_t index = 0;
+        for (index = 0; index < payloadCount && result == 0; index++)
         {
             // Add the Payload
             size_t offsetLen = BUFFER_length(ctrlPacket);
@@ -1048,7 +1050,8 @@
     {
         /* Codes_SRS_MQTT_CODEC_07_033: [mqtt_codec_bytesReceived constructs a sequence of bytes into the corresponding MQTT packets and on success returns zero.] */
         result = 0;
-        for (size_t index = 0; index < size && result == 0; index++)
+        size_t index = 0;
+        for (index = 0; index < size && result == 0; index++)
         {
             uint8_t iterator = ((int8_t*)buffer)[index];
             if (codec_Data->codecState == CODEC_STATE_FIXED_HEADER)