more debug messages from Matthew Burgess xmlSchemaValidateLengthFacet API

* xmlschemas.c: more debug messages from Matthew Burgess
* xmlschemastypes.c: xmlSchemaValidateLengthFacet API missing check.
Daniel
diff --git a/xmlschemastypes.c b/xmlschemastypes.c
index b08012a..159ad2a 100644
--- a/xmlschemastypes.c
+++ b/xmlschemastypes.c
@@ -4688,6 +4688,8 @@
 			     xmlSchemaValPtr val,
 			     unsigned long *length)  
 {
+    if (type == NULL)
+        return(-1);
     return (xmlSchemaValidateLengthFacetInternal(facet,
 	type->builtInType, value, val, length,
 	XML_SCHEMA_WHITESPACE_UNKNOWN));