small enhancement to prevent trying to print strings with null pointers
* testSAX.c: small enhancement to prevent trying to print
strings with null pointers (caused "make tests" errors on
HP-UX)
diff --git a/ChangeLog b/ChangeLog
index da93d29..466b026 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sat Feb 28 22:35:32 HKT 2004 William Brack <wbrack@mmm.com.hk>
+
+ * testSAX.c: small enhancement to prevent trying to print
+ strings with null pointers (caused "make tests" errors on
+ HP-UX)
+
Thu Feb 26 20:19:40 MST 2004 John Fleck <jfleck@inkstain.net>
* doc/xmllint.xml
diff --git a/testSAX.c b/testSAX.c
index 538c8d7..accd2f3 100644
--- a/testSAX.c
+++ b/testSAX.c
@@ -437,6 +437,14 @@
entityDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, int type,
const xmlChar *publicId, const xmlChar *systemId, xmlChar *content)
{
+const xmlChar *nullstr = BAD_CAST "(null)";
+ /* not all libraries handle printing null pointers nicely */
+ if (publicId == NULL)
+ publicId = nullstr;
+ if (systemId == NULL)
+ systemId = nullstr;
+ if (content == NULL)
+ content = (xmlChar *)nullstr;
callbacks++;
if (quiet)
return;
@@ -524,6 +532,14 @@
const xmlChar *publicId, const xmlChar *systemId,
const xmlChar *notationName)
{
+const xmlChar *nullstr = BAD_CAST "(null)";
+
+ if (publicId == NULL)
+ publicId = nullstr;
+ if (systemId == NULL)
+ systemId = nullstr;
+ if (notationName == NULL)
+ notationName = nullstr;
callbacks++;
if (quiet)
return;