guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] 02/03: Copy terminating zero in 'scm_cat_path'.


From: Ludovic Courtès
Subject: [Guile-commits] 02/03: Copy terminating zero in 'scm_cat_path'.
Date: Thu, 20 Jun 2019 06:26:31 -0400 (EDT)

civodul pushed a commit to branch stable-2.2
in repository guile.

commit 8cf7b06d24162d542d8fddb4f88287f1f7754bbb
Author: Ludovic Courtès <address@hidden>
Date:   Thu Jun 20 11:43:08 2019 +0200

    Copy terminating zero in 'scm_cat_path'.
    
    * libguile/script.c (scm_cat_path): Pass N + 1, not N, to 'strncat'.
    Reported by GCC 9.1.0.
---
 libguile/script.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libguile/script.c b/libguile/script.c
index 63fbb0f..30d3c9b 100644
--- a/libguile/script.c
+++ b/libguile/script.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-1998, 2000-2011, 2013, 2014 Free Software Foundation, 
Inc.
+/* Copyright (C) 1994-1998, 2000-2011, 2013, 2014, 2019 Free Software 
Foundation, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
@@ -73,7 +73,7 @@ scm_cat_path (char *str1, const char *str2, long n)
   if (!str1)
     return 0L;
   str1[0] = 0;
-  strncat (str1, str2, n);
+  strncat (str1, str2, n + 1);
   return str1;
 }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]