Is this func correct?

Pavel Machek pavel at ucw.cz
Mon Jan 8 11:53:56 CET 2001


Hi!

> Maybe i totally miss the point, is this func correct: int
> password_same(struct password_item *old, struct password_item *new) {
>   if (old == new)
>     return 1;
>   if ((!old) || (!new))
>     return 0;
>   return ((old->from == new->from) &&
> 	  (old->to == new->to) &&
> 	  (old->passive == new->passive) &&
> 	  password_same(old, new));
> }
> 
> or the last line should be 
>   return ((old->from == new->from) &&
>           (old->to == new->to) &&
>           (old->passive == new->passive) &&
>           password_same(old->next, new->next)); or compare old->password
> with new->password

That probably should be old->next, because otherwise it looks like
infinite loop to me.
								Pavel
-- 
The best software in life is free (not shareware)!		Pavel
GCM d? s-: !g p?:+ au- a--@ w+ v- C++@ UL+++ L++ N++ E++ W--- M- Y- R+



More information about the Bird-users mailing list