diff --git a/library/yap2swi/yap2swi.c b/library/yap2swi/yap2swi.c index f319fc8d1..32e3d622d 100755 --- a/library/yap2swi/yap2swi.c +++ b/library/yap2swi/yap2swi.c @@ -400,6 +400,7 @@ X_API int PL_get_chars(term_t l, char **sp, unsigned flags) putc_cur_lim = tmp+(BUF_SIZE-1); } Yap_plwrite(t, do_yap_putc, write_flags, 1200); + *putc_cur_buf = '\0'; /* may have changed due to overflows */ *sp = putc_cur_buf; return TRUE;