1
Fork 0
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:
Rob Browning 2005-10-15 01:54:54 +00:00
parent fc846c0f53
commit e43af77c81

View file

@ -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);