mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-29 19:30:36 +02:00
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.
This commit is contained in:
parent
d59dc5fbf2
commit
8cf7b06d24
1 changed files with 2 additions and 2 deletions
|
@ -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
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public License
|
* 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)
|
if (!str1)
|
||||||
return 0L;
|
return 0L;
|
||||||
str1[0] = 0;
|
str1[0] = 0;
|
||||||
strncat (str1, str2, n);
|
strncat (str1, str2, n + 1);
|
||||||
return str1;
|
return str1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue