From c8479541bbc272102c61dc00f8eda75ce181c1f9 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Sun, 28 Feb 2010 09:30:58 +0000 Subject: [PATCH] fix bad overflow handling in peek_memory_stream (obs from Jos De Roo). --- C/iopreds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C/iopreds.c b/C/iopreds.c index 6044d8f06..01f05c897 100755 --- a/C/iopreds.c +++ b/C/iopreds.c @@ -3401,7 +3401,7 @@ p_peek_mem_write_stream (void) Yap_Error(OUT_OF_STACK_ERROR, TermNil, Yap_ErrorMessage); return(FALSE); } - i = 0; + i = Stream[sno].u.mem_string.pos; tf = ARG2; LOCK(Stream[sno].streamlock); goto restart;