mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 20:00:19 +02:00
(s_scm_ctermid): Use a fixed size buffer of length
L_ctermid for the ctermid() result rather than passing NULL and expecting a static pointer. This fixes a problem caused when glibc sets a __nonnull attribute for ctermid() whenever __USE_XOPEN is defined.
This commit is contained in:
parent
fc846c0f53
commit
e43af77c81
1 changed files with 2 additions and 1 deletions
|
@ -797,7 +797,8 @@ SCM_DEFINE (scm_ctermid, "ctermid", 0, 0, 0,
|
||||||
"terminal for the current process.")
|
"terminal for the current process.")
|
||||||
#define FUNC_NAME s_scm_ctermid
|
#define FUNC_NAME s_scm_ctermid
|
||||||
{
|
{
|
||||||
char *result = ctermid (NULL);
|
char result[L_ctermid];
|
||||||
|
ctermid (result);
|
||||||
if (*result == '\0')
|
if (*result == '\0')
|
||||||
SCM_SYSERROR;
|
SCM_SYSERROR;
|
||||||
return scm_makfrom0str (result);
|
return scm_makfrom0str (result);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue