(scm_cuserid): Use a private result buffer, for thread safe.
authorKevin Ryde <user42@zip.com.au>
Mon, 23 Feb 2004 22:05:37 +0000 (22:05 +0000)
committerKevin Ryde <user42@zip.com.au>
Mon, 23 Feb 2004 22:05:37 +0000 (22:05 +0000)
libguile/posix.c

index 14c80f3..bed16a0 100644 (file)
@@ -1498,9 +1498,10 @@ SCM_DEFINE (scm_cuserid, "cuserid", 0, 0, 0,
            "information cannot be obtained.")
 #define FUNC_NAME s_scm_cuserid
 {
+  char buf[L_cuserid];
   char * p;
 
-  p = cuserid (NULL);
+  p = cuserid (buf);
   if (!p || !*p)
     return SCM_BOOL_F;
   return scm_makfrom0str (p);