From dfe3440e911101399dbd1ba6ae9a5a4d1eaee637 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Mon, 14 Nov 2011 11:53:28 +0900 Subject: [PATCH] Adding type check to get-output-string. --- sexp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sexp.c b/sexp.c index 4cd9a989..bb5c34ee 100644 --- a/sexp.c +++ b/sexp.c @@ -1221,7 +1221,9 @@ sexp sexp_make_output_string_port_op (sexp ctx, sexp self, sexp_sint_t n) { } sexp sexp_get_output_string_op (sexp ctx, sexp self, sexp_sint_t n, sexp port) { - sexp cookie = sexp_port_cookie(port); + sexp cookie; + sexp_assert_type(ctx, sexp_oportp, SEXP_OPORT, port); + cookie = sexp_port_cookie(port); fflush(sexp_port_stream(port)); return sexp_substring(ctx, sexp_stream_buf(cookie),