mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-12 14:50:19 +02:00
* backtrace.c (scm_display_error_message): Bugfix: Don't use
result of scm_list_p as C boolean. (scm_display_error_message, scm_set_print_params_x): Use new validation macros. (Thanks to Dirk Herrmann.)
This commit is contained in:
parent
d06bcb02eb
commit
3fceef5984
1 changed files with 11 additions and 9 deletions
|
@ -109,16 +109,16 @@ display_header (SCM source, SCM port)
|
||||||
void
|
void
|
||||||
scm_display_error_message (SCM message, SCM args, SCM port)
|
scm_display_error_message (SCM message, SCM args, SCM port)
|
||||||
{
|
{
|
||||||
if (SCM_IMP (message) || !SCM_ROSTRINGP (message) || SCM_IMP (args)
|
if (SCM_ROSTRINGP (message) && SCM_NFALSEP (scm_list_p (args)))
|
||||||
|| !scm_list_p (args))
|
{
|
||||||
|
scm_simple_format (port, message, args);
|
||||||
|
scm_newline (port);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
scm_prin1 (message, port, 0);
|
scm_prin1 (message, port, 0);
|
||||||
scm_putc ('\n', port);
|
scm_putc ('\n', port);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
scm_simple_format(port,message,args);
|
|
||||||
scm_newline(port);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -263,11 +263,13 @@ SCM_DEFINE (scm_set_print_params_x, "set-print-params!", 1, 0, 0,
|
||||||
"")
|
"")
|
||||||
#define FUNC_NAME s_scm_set_print_params_x
|
#define FUNC_NAME s_scm_set_print_params_x
|
||||||
{
|
{
|
||||||
int i, n = scm_ilength (params);
|
int i;
|
||||||
|
int n;
|
||||||
SCM ls;
|
SCM ls;
|
||||||
print_params_t *new_params;
|
print_params_t *new_params;
|
||||||
SCM_ASSERT (n >= 1, params, SCM_ARG2, FUNC_NAME);
|
|
||||||
for (ls = params; SCM_NIMP (ls); ls = SCM_CDR (ls))
|
SCM_VALIDATE_NONEMPTYLIST_COPYLEN (2, params, n);
|
||||||
|
for (ls = params; SCM_NNULLP (ls); ls = SCM_CDR (ls))
|
||||||
SCM_ASSERT (scm_ilength (SCM_CAR (params)) == 2
|
SCM_ASSERT (scm_ilength (SCM_CAR (params)) == 2
|
||||||
&& SCM_INUMP (SCM_CAAR (ls))
|
&& SCM_INUMP (SCM_CAAR (ls))
|
||||||
&& SCM_INUM (SCM_CAAR (ls)) >= 0
|
&& SCM_INUM (SCM_CAAR (ls)) >= 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue