From f5993028ffea67ec7f161f9275e97bc16c025129 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Sun, 9 Sep 2007 08:22:12 +0000 Subject: [PATCH] Don't allow attributes without values. --- CHANGES | 2 ++ mxml-file.c | 10 ++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 2bd5330..63c2870 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,8 @@ CHANGES - 2007-09-09 CHANGES IN Mini-XML 2.3.1 + - mxmlLoad*() incorrectly allowed attributes without values + (STR #47) - Fixed Visual C++ build problems (STR #49) - mxmlLoad*() did not return NULL when an element contained an error (STR #46) diff --git a/mxml-file.c b/mxml-file.c index 1d6560b..02d55e4 100644 --- a/mxml-file.c +++ b/mxml-file.c @@ -2255,7 +2255,7 @@ mxml_parse_element( { mxml_error("Missing value for attribute '%s' in element %s!", name, node->value.element.name); - return (EOF); + goto error; } if (ch == '\'' || ch == '\"') @@ -2315,11 +2315,9 @@ mxml_parse_element( } else { - /* - * Set the attribute with a NULL value... - */ - - mxmlElementSetAttr(node, name, NULL); + mxml_error("Missing value for attribute '%s' in element %s!", + name, node->value.element.name); + goto error; } /*