Commit 09a726f5 authored by William M. Brack's avatar William M. Brack

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)
parent e42ae6f9
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
......
......@@ -437,6 +437,14 @@ static void
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 @@ unparsedEntityDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment