applied patch from Mikhail Zabaluev to separate library flags for shared

* libxml-2.0.pc.in: applied patch from Mikhail Zabaluev to separate
  library flags for shared and static builds, fixes #344594. If this
  bites you, use xml2-config.
Daniel
diff --git a/ChangeLog b/ChangeLog
index 523165c..69b574a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Wed Oct 11 14:32:00 CEST 2006 Daniel Veillard <daniel@veillard.com>
+
+	* libxml-2.0.pc.in: applied patch from Mikhail Zabaluev to separate
+	  library flags for shared and static builds, fixes #344594. If this
+	  bites you, use xml2-config.
+
 Wed Oct 11 11:27:37 CEST 2006 Daniel Veillard <daniel@veillard.com>
 
 	* python/Makefile.am: remove the build path recorded in the python
diff --git a/libxml-2.0.pc.in b/libxml-2.0.pc.in
index c66f82b..075848c 100644
--- a/libxml-2.0.pc.in
+++ b/libxml-2.0.pc.in
@@ -8,5 +8,6 @@
 Version: @VERSION@
 Description: libXML library version2.
 Requires:
-Libs: -L${libdir} -lxml2 @THREAD_LIBS@ @Z_LIBS@ @ICONV_LIBS@ @M_LIBS@ @LIBS@
+Libs: -L${libdir} -lxml2
+Libs.private: @THREAD_LIBS@ @Z_LIBS@ @ICONV_LIBS@ @M_LIBS@ @LIBS@
 Cflags: @XML_INCLUDEDIR@ @XML_CFLAGS@
diff --git a/xmlschemastypes.c b/xmlschemastypes.c
index 987f85f..a35c539 100644
--- a/xmlschemastypes.c
+++ b/xmlschemastypes.c
@@ -5715,6 +5715,8 @@
 		if ((dec.frac == 0) || (dec.frac == dec.total))
 		    bufsize++;
 		buf = xmlMalloc(bufsize);
+		if (buf == NULL)
+		    return(-1);
 		offs = buf;
 		if (dec.sign)
 		    *offs++ = '-';
@@ -5788,6 +5790,8 @@
 		if (dec.sign)
 		    bufsize++;
 		*retValue = xmlMalloc(bufsize);
+		if (*retValue == NULL)
+		    return(-1);
 		if (dec.hi != 0) {
 		    if (dec.sign)
 			snprintf((char *) *retValue, bufsize,
@@ -5863,7 +5867,9 @@
 	case XML_SCHEMAS_GMONTH: {
 		/* TODO: Unclear in XML Schema 1.0 */
 		/* TODO: What to do with the timezone? */
-		*retValue = xmlMalloc(5);
+		*retValue = xmlMalloc(6);
+		if (*retValue == NULL)
+		    return(-1);
 		snprintf((char *) *retValue, 6, "--%02u",
 		    val->value.date.mon);
 	    }
@@ -5872,6 +5878,8 @@
 		/* TODO: Unclear in XML Schema 1.0 */
 		/* TODO: What to do with the timezone? */
 		*retValue = xmlMalloc(6);
+		if (*retValue == NULL)
+		    return(-1);
 		snprintf((char *) *retValue, 6, "---%02u",
 		    val->value.date.day);
 	    }
@@ -5880,6 +5888,8 @@
 		/* TODO: Unclear in XML Schema 1.0 */
 		/* TODO: What to do with the timezone? */
 		*retValue = xmlMalloc(8);
+		if (*retValue == NULL)
+		    return(-1);
 		snprintf((char *) *retValue, 8, "--%02u-%02u",
 		    val->value.date.mon, val->value.date.day);
 	    }
@@ -6024,6 +6034,8 @@
 	    *retValue = BAD_CAST xmlStrdup(BAD_CAST "???");
 	    return (1);
     }
+    if (*retValue == NULL)
+	return(-1);
     return (0);
 }