1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-12 06:41:13 +02:00

* numbers.c (scm_string_to_number): Signal an error if radix is

less than two.  (Thanks to Jorgen Schaefer.)

* print.c (scm_write, scm_display, scm_newline, scm_write_char):
Don't assume that the current output port is valid.  Somebody
might close it.  (Thanks to Bernard Urban.)
This commit is contained in:
Jim Blandy 1999-10-05 18:57:31 +00:00
parent dc4d930b43
commit 3eb7e6ee5e
2 changed files with 13 additions and 9 deletions

View file

@ -2450,7 +2450,11 @@ scm_string_to_number (str, radix)
if (SCM_UNBNDP (radix))
radix = SCM_MAKINUM (10L);
else
{
SCM_ASSERT (SCM_INUMP (radix), radix, SCM_ARG2, s_string_to_number);
SCM_ASSERT (SCM_INUM (radix) >= 2, radix, SCM_OUTOFRANGE,
s_number_to_string);
}
SCM_ASSERT (SCM_NIMP (str) && SCM_ROSTRINGP (str),
str, SCM_ARG1, s_string_to_number);
answer = scm_istring2number (SCM_ROCHARS (str),

View file

@ -917,7 +917,7 @@ scm_write (obj, port)
{
if (SCM_UNBNDP (port))
port = scm_cur_outp;
else
SCM_ASSERT (scm_valid_oport_value_p (port), port, SCM_ARG2, s_write);
scm_prin1 (obj, port, 1);
@ -940,7 +940,7 @@ scm_display (obj, port)
{
if (SCM_UNBNDP (port))
port = scm_cur_outp;
else
SCM_ASSERT (scm_valid_oport_value_p (port), port, SCM_ARG2, s_display);
scm_prin1 (obj, port, 0);
@ -961,7 +961,7 @@ scm_newline (port)
{
if (SCM_UNBNDP (port))
port = scm_cur_outp;
else
SCM_ASSERT (scm_valid_oport_value_p (port), port, SCM_ARG1, s_newline);
scm_putc ('\n', SCM_COERCE_OUTPORT (port));
@ -977,7 +977,7 @@ scm_write_char (chr, port)
{
if (SCM_UNBNDP (port))
port = scm_cur_outp;
else
SCM_ASSERT (scm_valid_oport_value_p (port), port, SCM_ARG2, s_write_char);
SCM_ASSERT (SCM_ICHRP (chr), chr, SCM_ARG1, s_write_char);