[xml] Question about xmlXPathCastStringToBoolean function



Hey Daniel, All

is the implementation of xmlXPathCastStringToBoolean really correct?
I at least would have expected this function to return '0' if the input is a string like 'false'.
In the current (2.5.7) implementation a call like:
   if ( xmlXPathCastStringToBoolean(BAD_CAST "false") )
would evaluate to true;

Regards
   Matthias

See:
int
xmlXPathCastStringToBoolean (const xmlChar *val) {
   if ((val == NULL) || (xmlStrlen(val) == 0))
   return(0);
   return(1);
}




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