mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-01-14 19:24:06 +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:
parent
e42ae6f991
commit
09a726f5ab
@ -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
|
||||
|
16
testSAX.c
16
testSAX.c
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user