From b323d17369f4b547b3eaef3f78189b933e2d453f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Thu, 5 Nov 2015 16:56:59 +0000 Subject: [PATCH] small fix --- os/mem.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/os/mem.c b/os/mem.c index fd84b326d..6a0041566 100644 --- a/os/mem.c +++ b/os/mem.c @@ -259,7 +259,6 @@ Yap_open_buf_write_stream(char *buf, size_t nchars, encoding_t *encp, memBufSou return -1; } st->nsize = nchars; - /* currently these streams are not seekable */ st->linepos = 0; st->charcount = 0; st->linecount = 1; @@ -324,9 +323,9 @@ Yap_MemExportStreamPtr( int sno ) { char *s; #if MAY_WRITE - if (fflush(GLOBAL_Stream[sno].file) == 0 && - (s = GLOBAL_Stream[sno].nbuf)) { - s[ftell(GLOBAL_Stream[sno].file)] = '\0'; + if (fflush(GLOBAL_Stream[sno].file) == 0) + { + s = GLOBAL_Stream[sno].nbuf; return s; } return NULL;