simple-format: Don't assume the current output port is valid.
authorMark H Weaver <mhw@netris.org>
Wed, 19 Mar 2014 21:55:20 +0000 (17:55 -0400)
committerMark H Weaver <mhw@netris.org>
Wed, 19 Mar 2014 21:55:20 +0000 (17:55 -0400)
* libguile/print.c (scm_simple_format): Validate the current output
  port.

libguile/print.c

index ae98af4..60683b5 100644 (file)
@@ -1468,6 +1468,7 @@ SCM_DEFINE (scm_simple_format, "simple-format", 2, 0, 1,
   if (scm_is_eq (destination, SCM_BOOL_T))
     {
       destination = port = scm_current_output_port ();
+      SCM_VALIDATE_OPORT_VALUE (0, destination);
     }
   else if (scm_is_false (destination))
     {