mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 11:50:28 +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.")
|
||||
#define FUNC_NAME s_scm_ctermid
|
||||
{
|
||||
char *result = ctermid (NULL);
|
||||
char result[L_ctermid];
|
||||
ctermid (result);
|
||||
if (*result == '\0')
|
||||
SCM_SYSERROR;
|
||||
return scm_makfrom0str (result);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue