[xml] Minor path for xmltree.c : xmlNodeSetName
- From: "Martin B." <0xCDCDCDCD gmx at>
- To: xml gnome org
- Subject: [xml] Minor path for xmltree.c : xmlNodeSetName
- Date: Thu, 21 Jan 2010 13:58:56 +0100
While compiling an older version (2.6.27) and then re-checking with the
newest code, I found that there's a minor casting issue in
xmlNodeSetBase(..). It's purely cosmetic, but it cost me time trying to
figure out what's going on, so I though it probably should be changed to
use a const-correct local variable.
Patch vs. HEAD looks like this:
########################################
xmlNodeSetName: Remove const from declaration 'const xmlChar* fixed'
since it is used non-const anyway. Remove unnecessary cast on xmlFree
later on.
########################################
diff --git a/tree.c b/tree.c
index ffebf06..3b66f97 100644
--- a/tree.c
+++ b/tree.c
@@ -5056,7 +5056,7 @@ xmlNodeSetName(xmlNodePtr cur, const xmlChar *name) {
void
xmlNodeSetBase(xmlNodePtr cur, const xmlChar* uri) {
xmlNsPtr ns;
- const xmlChar* fixed;
+ xmlChar* fixed;
if (cur == NULL) return;
switch(cur->type) {
@@ -5103,7 +5103,7 @@ xmlNodeSetBase(xmlNodePtr cur, const xmlChar* uri) {
fixed = xmlPathToURI(uri);
if (fixed != NULL) {
xmlSetNsProp(cur, ns, BAD_CAST "base", fixed);
- xmlFree((xmlChar *)fixed);
+ xmlFree(fixed);
} else {
xmlSetNsProp(cur, ns, BAD_CAST "base", uri);
}
########################################
cheers,
Martin
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]