[gnome-builder] foundry: use g_strndup() instead of g_memdup()



commit 4953fc01fbf57edf70cf45dd76e39c8f950ea5fb
Author: Christian Hergert <chergert redhat com>
Date:   Thu Feb 4 10:47:44 2021 -0800

    foundry: use g_strndup() instead of g_memdup()
    
    We already know the length here anyway and it will give us a \0 suffix.

 src/libide/foundry/ide-pipeline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/libide/foundry/ide-pipeline.c b/src/libide/foundry/ide-pipeline.c
index d11a2ed78..3ff848c61 100644
--- a/src/libide/foundry/ide-pipeline.c
+++ b/src/libide/foundry/ide-pipeline.c
@@ -662,7 +662,7 @@ extract_directory_change (IdePipeline  *self,
     return FALSE;
 
   len = &data[len - 1] - begin;
-  dir = g_memdup (begin, len);
+  dir = g_strndup (begin, len);
 
   if (g_utf8_validate (dir, len, NULL))
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]