summaryrefslogtreecommitdiffstats
path: root/src/xml/quote.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2014-01-12 19:02:53 +0000
committerJabiertxof <jtx@jtx.marker.es>2014-01-12 19:02:53 +0000
commitad38e0a823da469ba8a4866e0d6c46c87ed1b69c (patch)
tree10d2a97375a51ad9ab32e9de58a1fb513e82cdef /src/xml/quote.cpp
parentUpdate to trunk (diff)
parentpass class variables by reference for performance (diff)
downloadinkscape-ad38e0a823da469ba8a4866e0d6c46c87ed1b69c.tar.gz
inkscape-ad38e0a823da469ba8a4866e0d6c46c87ed1b69c.zip
update to trunk
(bzr r12588.1.31)
Diffstat (limited to 'src/xml/quote.cpp')
-rw-r--r--src/xml/quote.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/xml/quote.cpp b/src/xml/quote.cpp
index c9e001d05..02c12dfb0 100644
--- a/src/xml/quote.cpp
+++ b/src/xml/quote.cpp
@@ -23,13 +23,15 @@ size_t
xml_quoted_strlen(char const *val)
{
size_t ret = 0;
- for (; *val != '\0'; val++) {
- switch (*val) {
- case '"': ret += sizeof("&quot;") - 1; break;
- case '&': ret += sizeof("&amp;") - 1; break;
- case '<': ret += sizeof("&lt;") - 1; break;
- case '>': ret += sizeof("&gt;") - 1; break;
- default: ++ret; break;
+ if (val != NULL) {
+ for (; *val != '\0'; val++) {
+ switch (*val) {
+ case '"': ret += sizeof("&quot;") - 1; break;
+ case '&': ret += sizeof("&amp;") - 1; break;
+ case '<': ret += sizeof("&lt;") - 1; break;
+ case '>': ret += sizeof("&gt;") - 1; break;
+ default: ++ret; break;
+ }
}
}
return ret;