From e43af77c81e079e4abe2967d17b620d92f75c94f Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Sat, 15 Oct 2005 01:54:54 +0000 Subject: [PATCH] (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. --- libguile/posix.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libguile/posix.c b/libguile/posix.c index 9c304b00a..4cacd70b4 100644 --- a/libguile/posix.c +++ b/libguile/posix.c @@ -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);