diff --git a/ChangeLog b/ChangeLog index d6da149a..61a09ac0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun Aug 26 20:45:04 CEST 2001 Daniel Veillard + + * valid.c: fixed a Windows compiler warning (Chris Poblete) + * xpath.c: fix for mod when dividend is 0 (Chris Poblete) + Sat Aug 25 15:30:17 CEST 2001 Daniel Veillard * include/libxml/catalog.h catalog.c xmlcatalog.c: added a diff --git a/valid.c b/valid.c index 7e4e4df5..29bfcfad 100644 --- a/valid.c +++ b/valid.c @@ -3479,7 +3479,8 @@ cont: * save the second branch 'or' branch */ DEBUG_VALID_MSG("saving 'or' branch"); - vstateVPush(ctxt, CONT->c2, NODE, DEPTH + 1, OCCURS, ROLLBACK_OR); + vstateVPush(ctxt, CONT->c2, NODE, (unsigned char)(DEPTH + 1), + OCCURS, ROLLBACK_OR); DEPTH++; CONT = CONT->c1; diff --git a/xpath.c b/xpath.c index b716fa61..0dba1f02 100644 --- a/xpath.c +++ b/xpath.c @@ -4422,7 +4422,10 @@ xmlXPathModValues(xmlXPathParserContextPtr ctxt) { CAST_TO_NUMBER; CHECK_TYPE(XPATH_NUMBER); arg1 = (int) ctxt->value->floatval; - ctxt->value->floatval = arg1 % arg2; + if (arg2 == 0) + ctxt->value->floatval = xmlXPathNAN; + else + ctxt->value->floatval = arg1 % arg2; } /************************************************************************