diff src/dmgrowbuf.c @ 1814:0b7062d874ef

Use dmMemset() instead of memset().
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 21 Jun 2018 17:22:32 +0300
parents 0801fd0e26cb
children ca9fe688ab6b
line wrap: on
line diff
--- a/src/dmgrowbuf.c	Thu Jun 21 13:07:44 2018 +0300
+++ b/src/dmgrowbuf.c	Thu Jun 21 17:22:32 2018 +0300
@@ -22,7 +22,7 @@
     if (buf == NULL)
         return DMERR_NULLPTR;
 
-    memset(buf, 0, sizeof(DMGrowBuf));
+    dmMemset(buf, 0, sizeof(DMGrowBuf));
 
     return DMERR_OK;
 }
@@ -68,7 +68,7 @@
             return;
 
         dmFree(buf->data);
-        memset(buf, 0, sizeof(DMGrowBuf));
+        dmMemset(buf, 0, sizeof(DMGrowBuf));
     }
 }
 
@@ -90,14 +90,14 @@
     if ((dst->data = dmMalloc(dst->size)) == NULL)
     {
         // If that fails, clear the struct
-        memset(dst, 0, sizeof(DMGrowBuf));
+        dmMemset(dst, 0, sizeof(DMGrowBuf));
         return NULL;
     }
 
     // Copy data
     memcpy(dst->data, src->data, src->size);
     if (enlarge > 0)
-        memset(dst->data + src->size, 0, enlarge);
+        dmMemset(dst->data + src->size, 0, enlarge);
     
     // And reset some struct information
     dst->is_const = FALSE;
@@ -183,9 +183,9 @@
     if (clear)
     {
         if (buf->backwards)
-            memset(buf->data, 0, clrsize);
+            dmMemset(buf->data, 0, clrsize);
         else
-            memset(buf->data + buf->size, 0, clrsize);
+            dmMemset(buf->data + buf->size, 0, clrsize);
     }
 
     buf->size = nsize;