Azure IoT common library

Dependents:   STM32F746_iothub_client_sample_mqtt f767zi_mqtt iothub_client_sample_amqp iothub_client_sample_http ... more

Revision:
19:2e0811512ceb
Parent:
16:18e7ebd42bb2
Child:
21:b92006c5b9ff
diff -r 6d8a413a4d9a -r 2e0811512ceb strings.c
--- a/strings.c	Fri Jan 13 18:41:15 2017 -0800
+++ b/strings.c	Sat Jan 28 09:35:22 2017 -0800
@@ -5,11 +5,7 @@
 // PUT NO INCLUDES BEFORE HERE
 //
 #include <stdlib.h>
-#ifdef _CRTDBG_MAP_ALLOC
-#include <crtdbg.h>
-#endif
 #include "azure_c_shared_utility/gballoc.h"
-
 #include <stddef.h>
 #include <string.h>
 #include <stdarg.h>
@@ -75,7 +71,7 @@
             }
             else
             {
-                memcpy(result->s, source->s, sourceLen + 1);
+                (void)memcpy(result->s, source->s, sourceLen + 1);
             }
         }
         else
@@ -103,7 +99,7 @@
             size_t nLen = strlen(psz) + 1;
             if ((str->s = (char*)malloc(nLen)) != NULL)
             {
-                memcpy(str->s, psz, nLen);
+                (void)memcpy(str->s, psz, nLen);
                 result = (STRING_HANDLE)str;
             }
             /* Codes_SRS_STRING_07_032: [STRING_construct encounters any error it shall return a NULL value.] */
@@ -232,7 +228,7 @@
         if ((result->s = (char*)malloc(sourceLength + 3)) != NULL)
         {
             result->s[0] = '"';
-            memcpy(result->s + 1, source, sourceLength);
+            (void)memcpy(result->s + 1, source, sourceLength);
             result->s[sourceLength + 1] = '"';
             result->s[sourceLength + 2] = '\0';
         }
@@ -386,7 +382,7 @@
         else
         {
             s1->s = temp;
-            memcpy(s1->s + s1Length, s2, s2Length + 1);
+            (void)memcpy(s1->s + s1Length, s2, s2Length + 1);
             result = 0;
         }
     }
@@ -422,7 +418,7 @@
         {
             dest->s = temp;
             /* Codes_SRS_STRING_07_034: [String_Concat_with_STRING shall concatenate a given STRING_HANDLE variable with a source STRING_HANDLE.] */
-            memcpy(dest->s + s1Length, src->s, s2Length + 1);
+            (void)memcpy(dest->s + s1Length, src->s, s2Length + 1);
             result = 0;
         }
     }
@@ -501,7 +497,7 @@
         else
         {
             s1->s = temp;
-            memcpy(s1->s, s2, s2Length);
+            (void)memcpy(s1->s, s2, s2Length);
             s1->s[s2Length] = 0;
             result = 0;
         }
@@ -715,7 +711,7 @@
             {
                 if ((str->s = (char*)malloc(len + 1)) != NULL)
                 {
-                    memcpy(str->s, psz, n);
+                    (void)memcpy(str->s, psz, n);
                     str->s[n] = '\0';
                     result = (STRING_HANDLE)str;
                 }
@@ -797,7 +793,7 @@
             }
             else
             {
-                memcpy(result->s, source, size);
+                (void)memcpy(result->s, source, size);
                 result->s[size] = '\0'; /*all is fine*/
             }
         }