Re: various part 2



> > see yourself. it checks for some stuff and returns
> > false, then checks for one stuff and returns true
> > and definately returns false if not found. so i
> > changed this to check only for TRUE and if its not
> > found return FALSE.
> > 
> ...
> > 
> > --- balsa-cvs/src/message-window.c	Wed Oct 17 13:57:43 2001
> > +++ balsa/src/message-window.c	Wed Oct 17 15:34:24 2001
> > @@ -826,22 +826,17 @@
> >  find_url_cb(GNode *gnode, struct BalsaMRUEntry *data)
> >  {
> >      BalsaMailboxNode *node;
> > -
> > +
> >      node=gnode->data;
> > -    if(!node || !BALSA_IS_MAILBOX_NODE(node))
> > -	return(FALSE);
> > -
> > -    if(!node->mailbox)
> > -	return(FALSE);
> > -
> > +
> >      if(!strcmp(LIBBALSA_MAILBOX(node->mailbox)->url, data->url)) {
> ...
> This will segfault if either node == NULL or node->mailbox == NULL.  
> That's why those conditional `return's are there.

yeah but it does this

label:

     check: return false
     check: return false
     check: return true

     definately return false:

so in my opinion checking for true is enough and then else back with false.

-- 
Name....: Ali Akcaagac
Status..: Student Of Computer & Economic Science
E-Mail..: mailto:ali.akcaagac@stud.fh-wilhelmshaven.de
WWW.....: http://www.fh-wilhelmshaven.de/~akcaagaa



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]