From 7fa7f7b1ff8f20db938e4d62cc4507dcc717d808 Mon Sep 17 00:00:00 2001 From: css1dw Date: Mon, 15 Dec 1997 19:58:15 +0000 Subject: [PATCH] fixed embarrassing bug in print_all_params - null check in the wrong place - failed to check properly! --- decs.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/decs.c b/decs.c index 8e921f9..5b69527 100644 --- a/decs.c +++ b/decs.c @@ -882,15 +882,16 @@ static void print_all_params( d, s ) declnlist d; shapelist s; } else { n = pl->item->num; - for( p = s->params; --n; p = p->next ) + for( p = s->params; p != NULL && --n; + p = p->next ) + ; + + if( p == NULL ) { - if( p == NULL ) - { - fprintf( stderr, + fprintf( stderr, "datadec: bad printitem in shape %s of type %s\n", s->name, d->name ); - exit(1); - } + exit(1); } print_param( s, p, d->Union ); } -- GitLab