Microsoft Azure IoTHub client libraries

Dependents:   sht15_remote_monitoring RobotArmDemo iothub_client_sample_amqp f767zi_mqtt ... more

This library implements the Microsoft Azure IoTHub client library. The code is replicated from https://github.com/Azure/azure-iot-sdks

Revision:
75:86205ca63a59
Parent:
74:ea0021abecf7
Child:
77:e4e36df9caee
--- a/iothub_client_ll_uploadtoblob.c	Fri Aug 25 11:22:43 2017 -0700
+++ b/iothub_client_ll_uploadtoblob.c	Mon Sep 11 09:22:55 2017 -0700
@@ -101,9 +101,15 @@
             }
             else
             {
-                (void)memcpy((char*)handleData->hostname, config->iotHubName, iotHubNameLength);
-                ((char*)handleData->hostname)[iotHubNameLength] = '.';
-                (void)memcpy((char*)handleData->hostname + iotHubNameLength + 1, config->iotHubSuffix, iotHubSuffixLength + 1); /*+1 will copy the \0 too*/
+                char* insert_pos = (char*)handleData->hostname;
+                (void)memcpy((char*)insert_pos, config->iotHubName, iotHubNameLength);
+                insert_pos += iotHubNameLength;
+                *insert_pos = '.';
+                insert_pos += 1;
+                (void)memcpy(insert_pos, config->iotHubSuffix, iotHubSuffixLength); /*+1 will copy the \0 too*/
+                insert_pos += iotHubSuffixLength;
+                *insert_pos = '\0';
+
                 handleData->certificates = NULL;
                 memset(&(handleData->http_proxy_options), 0, sizeof(HTTP_PROXY_OPTIONS));