Re: [xml] possible bug? problematic if statement involving xmlStrcmp



Nick Torenvliet wrote:

I have a problematic if statement involving xmlStrcmp,
In the following(with appropriate argumnent) case doFoo() executes
nicely if(xmlStrcmp(pList->p_phkProcList[proc].p_segment[seg].xc_sId,pList->p_schedule[i].xc_sId)){ if(xmlStrcmp(pList->p_schedule[i].xc_sId,pList->xc_latestSId)){
                doFoo();
        }
}

But in the following case and with the same arguments doFoo() does not
execute...
if(xmlStrcmp(pList->p_phkProcList[proc].p_segment[seg].xc_sId,pList->p_schedule[i].xc_sId) &
xmlStrcmp(pList->p_schedule[i].xc_sId,pList->xc_latestSId)){
        doFoo();
}

I imagine I am missing something here any ideas?




_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xml gnome org
http://mail.gnome.org/mailman/listinfo/xml


It seems that a & is missing.

The correct form is:

if(xmlStrcmp(pList->p_phkProcList[proc].p_segment[seg].xc_sId,pList->p_schedule[i].xc_sId) &&
xmlStrcmp(pList->p_schedule[i].xc_sId,pList->xc_latestSId)){
        doFoo();
}


Bye

--Marco








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