[uim-commit] r2377 - branches/r5rs/sigscheme

kzk at freedesktop.org kzk at freedesktop.org
Mon Dec 5 09:31:50 PST 2005


Author: kzk
Date: 2005-12-05 09:31:37 -0800 (Mon, 05 Dec 2005)
New Revision: 2377

Modified:
   branches/r5rs/sigscheme/io.c
Log:
* This is a workaround fix for scm_current_error_port
  When error occurs in InitStorage or so, scm_current_error_port
  is not initialize (its value is NULL) and cause SEGV.

* sigscheme/io.c
  - (SigScm_PortPrintf, SigScm_VPortPrintf
     SigScm_PortNewline): add sanity check for port


Modified: branches/r5rs/sigscheme/io.c
===================================================================
--- branches/r5rs/sigscheme/io.c	2005-12-05 16:55:02 UTC (rev 2376)
+++ branches/r5rs/sigscheme/io.c	2005-12-05 17:31:37 UTC (rev 2377)
@@ -143,6 +143,9 @@
 {
     va_list args;
 
+    if (!port)
+        return;
+
     va_start(args, fmt);
     SigScm_VPortPrintf(port, fmt, args);
     va_end(args);
@@ -150,6 +153,9 @@
 
 void SigScm_VPortPrintf(ScmObj port, const char *fmt, va_list args)
 {
+    if (!port)
+        return;
+
     SCM_PORT_VPRINTF(port, fmt, args);
 #if SCM_VOLATILE_OUTPUT
     SCM_PORT_FLUSH(port);
@@ -158,6 +164,9 @@
 
 void SigScm_PortNewline(ScmObj port)
 {
+    if (!port)
+        return;
+
     SCM_PORT_PUTS(port, SCM_NEWLINE_STR);
     SCM_PORT_FLUSH(port);  /* required */
 }



More information about the uim-commit mailing list