about summary refs log tree commit diff
path: root/converter/other/svgtopam.c
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2017-03-28 01:50:27 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2017-03-28 01:50:27 +0000
commitc49d14be332e9939e7f9583b8f81fe9b977341f4 (patch)
tree17a8d237b3be47e880c00d27f5f282e1ec13dcb2 /converter/other/svgtopam.c
parent1e50cc0a1c2b29f06f451b220556990a1e4fc89a (diff)
downloadnetpbm-mirror-c49d14be332e9939e7f9583b8f81fe9b977341f4.tar.gz
netpbm-mirror-c49d14be332e9939e7f9583b8f81fe9b977341f4.tar.xz
netpbm-mirror-c49d14be332e9939e7f9583b8f81fe9b977341f4.zip
Release 10.47.64
git-svn-id: http://svn.code.sf.net/p/netpbm/code/super_stable@2928 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/other/svgtopam.c')
-rw-r--r--converter/other/svgtopam.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/converter/other/svgtopam.c b/converter/other/svgtopam.c
index c7eac8e6..68deb3e0 100644
--- a/converter/other/svgtopam.c
+++ b/converter/other/svgtopam.c
@@ -100,16 +100,23 @@ parseCommandLine(int argc,
 /*============================================================================
    Wrappers for libxml2 routines.
 
-   The difference is that these use conventional C data types and have
-   shorter names.
+   The difference is that these use conventional C data types, have shorter
+   names, and abort the program instead of returning a special value when they
+   fail.
 =============================================================================*/
 
 static const char *
 getAttribute(xmlTextReaderPtr const xmlReaderP,
              const char *     const attributeName) {
 
-    return (const char *)
+    const char * const rc = (const char *)
         xmlTextReaderGetAttribute(xmlReaderP, (const xmlChar *)attributeName);
+
+    if (rc == NULL)
+        pm_error("xmlTextReaderGetAttribute(\"%.256s\") failed.  ",
+                 attributeName);
+
+    return rc;
 }
 
 
@@ -117,7 +124,13 @@ getAttribute(xmlTextReaderPtr const xmlReaderP,
 static const char *
 currentNodeName(xmlTextReaderPtr const xmlReaderP) {
 
-    return (const char *)xmlTextReaderConstName(xmlReaderP);
+    const char * const rc = (const char *)
+        xmlTextReaderConstName(xmlReaderP);
+
+    if (rc == NULL)
+        pm_error("xmlTextReaderConstName() failed.  ");
+
+    return rc;
 }