summaryrefslogtreecommitdiffstats
path: root/src/xml/simple-node.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/xml/simple-node.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/xml/simple-node.cpp b/src/xml/simple-node.cpp
index 47f66ff85..fc74cfaec 100644
--- a/src/xml/simple-node.cpp
+++ b/src/xml/simple-node.cpp
@@ -13,6 +13,7 @@
* Released under GNU GPL v2+, read the file 'COPYING' for more information.
*/
+#include <algorithm>
#include <cstring>
#include <string>
@@ -321,6 +322,9 @@ SimpleNode::setAttribute(gchar const *name, gchar const *value, bool const /*is_
{
g_return_if_fail(name && *name);
+ // sanity check: `name` must not contain whitespace
+ g_assert(std::none_of(name, name + strlen(name), [](char c) { return g_ascii_isspace(c); }));
+
// Check usefulness of attributes on elements in the svg namespace, optionally don't add them to tree.
Glib::ustring element = g_quark_to_string(_name);
//g_message("setAttribute: %s: %s: %s", element.c_str(), name, value);