[gimp] Bug 795050 - ‘strncpy’ output truncated before terminating nul



commit 421c9fc51a25de283cfff4554ac29c7c833f5745
Author: Michael Natterer <mitch gimp org>
Date:   Wed Apr 11 11:31:02 2018 +0200

    Bug 795050 - ‘strncpy’ output truncated before terminating nul
    
    Use memcpy() because we really dont' want to copy the terminating nul,
    but we don't want a warning either.

 app/core/gimp-templates.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/app/core/gimp-templates.c b/app/core/gimp-templates.c
index f5a3643..da55364 100644
--- a/app/core/gimp-templates.c
+++ b/app/core/gimp-templates.c
@@ -140,7 +140,7 @@ gimp_templates_migrate_get_child_by_name (GimpContainer *container,
 
           if (dpi)
             {
-              strncpy (dpi, "ppi", 4);
+              memcpy (dpi, "ppi", 3);
 
               g_print ("replaced: %s\n", str1);
 


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