diff options
Diffstat (limited to 'src/utilfuns/utilxml.cpp')
-rw-r--r-- | src/utilfuns/utilxml.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/utilfuns/utilxml.cpp b/src/utilfuns/utilxml.cpp index 1537499..a4eeb2a 100644 --- a/src/utilfuns/utilxml.cpp +++ b/src/utilfuns/utilxml.cpp @@ -3,7 +3,7 @@ * utilxml.cpp - Implementaion of utility classes to handle * XML processing * - * $Id: utilxml.cpp 2980 2013-09-14 21:51:47Z scribe $ + * $Id: utilxml.cpp 3439 2016-10-23 08:32:02Z scribe $ * * Copyright 2003-2013 CrossWire Bible Society (http://www.crosswire.org) * CrossWire Bible Society @@ -85,16 +85,14 @@ void XMLTag::parse() const { for (; ((buf[i]) && (buf[i] != quoteChar)); i++); // Allow for empty quotes - //if (i-start) { - if (value) - delete [] value; - value = new char [ (i-start) + 1 ]; - if (i-start) { - strncpy(value, buf+start, i-start); - } - value[i-start] = 0; - attributes[name] = value; - //} + if (value) + delete [] value; + value = new char [ (i-start) + 1 ]; + if (i-start) { + strncpy(value, buf+start, i-start); + } + value[i-start] = 0; + attributes[name] = value; } } } @@ -130,12 +128,12 @@ XMLTag::XMLTag(const XMLTag& t) : attributes(t.attributes) { empty = t.empty; endTag = t.endTag; if (t.buf) { - int len = strlen(t.buf); + int len = (int)strlen(t.buf); buf = new char[len + 1]; memcpy(buf, t.buf, len + 1); } if (t.name) { - int len = strlen(t.name); + int len = (int)strlen(t.name); name = new char[len + 1]; memcpy(name, t.name, len + 1); } |