1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-17 17:20:29 +02:00

1999-09-18 Gary Houston <ghouston@freewire.co.uk>

* strports.c (scm_strport_to_string): create the string from
	pt->read_buf instead of an expression that evaluates to the
	same thing.

	* gdbint.c (gdb_print): don't just use SCM_CHARS to get a C string
	from the port: the port's buffer may not be NUL terminated.
This commit is contained in:
Gary Houston 1999-09-18 08:36:35 +00:00
parent 46a47bedc2
commit e684c60f44
3 changed files with 17 additions and 3 deletions

View file

@ -275,7 +275,13 @@ gdb_print (obj)
scm_seek (gdb_output_port, SCM_INUM0, SCM_MAKINUM (SEEK_SET));
scm_write (obj, gdb_output_port);
scm_truncate_file (gdb_output_port, SCM_UNDEFINED);
SEND_STRING (SCM_CHARS (SCM_STREAM (gdb_output_port)));
{
scm_port *pt = SCM_PTAB_ENTRY (gdb_output_port);
scm_flush (gdb_output_port);
*(pt->write_buf + pt->read_buf_size) = 0;
SEND_STRING (pt->read_buf);
}
SCM_END_FOREIGN_BLOCK;
return 0;
}