This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
[BUG] soft portsb
- To: guile at sourceware dot cygnus dot com
- Subject: [BUG] soft portsb
- From: Daniel Skarda <0rfelyus at atrey dot karlin dot mff dot cuni dot cz>
- Date: 28 Nov 1999 23:36:13 +0100
Hello,
I think that following code is not correct:
guile-1.3.4/libguile/vports.c:
static void
sf_write (SCM port, void *data, size_t size)
{
SCM p = SCM_STREAM (port);
scm_apply (SCM_VELTS (p)[1], scm_cons (scm_makfrom0str ((char *) data),
SCM_EOL),
SCM_EOL);
}
IMHO there should be scm_makfromstr ((char *) data, size, 0) - otherwise
(newline softport) creates garbage: scm_newline calls scm_putc and scm_putc
calls scm_lfwrite (&c, 1, port) /* c is newline character */ - but it is not
guaranteed that "char *" &c is terminated by \000.... :-(
Daniel Skarda