1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 20:25:14 +03:00

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)
This commit is contained in:
William M. Brack 2004-02-28 14:47:18 +00:00
parent e42ae6f991
commit 09a726f5ab
2 changed files with 22 additions and 0 deletions

View File

@ -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

View File

@ -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;