Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Sep 2000 11:37:50 -0600
From:      Warner Losh <imp@village.org>
To:        Falko Dressler <fd@bsd.rrze.uni-erlangen.de>
Cc:        freebsd-current@FreeBSD.ORG
Subject:   Re: bug in ccard.c (pccardd code) 
Message-ID:  <200009251737.LAA05096@harmony.village.org>
In-Reply-To: Your message of "Mon, 25 Sep 2000 17:57:44 %2B0200." <Pine.BSF.4.10.10009251754070.96250-100000@bsd.rrze.uni-erlangen.de> 
References:  <Pine.BSF.4.10.10009251754070.96250-100000@bsd.rrze.uni-erlangen.de>  

next in thread | previous in thread | raw e-mail | index | archive | help
In message <Pine.BSF.4.10.10009251754070.96250-100000@bsd.rrze.uni-erlangen.de> Falko Dressler writes:
: 
: I discovered a little bug in ccard.c which is part of the pccardd:
: 
: *** cardd.c.orig	Mon Sep 25 17:52:03 2000
: --- cardd.c	Mon Sep 25 17:52:12 2000
: ***************
: *** 546,552 ****
:   		sp->config->index = cisconf->id;
:   		break;
:   	default:		/* normal, use index value */
: ! 		for (cisconf = cis->conf; cisconf; cisconf = cisconf->next)
:   			if (cisconf->id == sp->config->index)
:   				break;
:   	}
: --- 546,552 ----
:   		sp->config->index = cisconf->id;
:   		break;
:   	default:		/* normal, use index value */
: ! 		for (cisconf = cis->conf; cisconf->next; cisconf = cisconf->next)
:   			if (cisconf->id == sp->config->index)
:   				break;
:   	}
: 
: 
: Someone forgot to place the right pointer into the for-loop.

Why does the change need to be made to cisconf->next.  The old code
looks good to me.  Is the last item in the list wrong for some reason?
The last item on the for loop will be evaluated, and then the middle
test is done, so I don't see how this helps.

Warner


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200009251737.LAA05096>