fix a problem with strcpy() in xmlXPathFormatNumber() valgrind pointed out
* xpath.c: fix a problem with strcpy() in xmlXPathFormatNumber()
valgrind pointed out the strings overlapped. cleanup .
Daniel
diff --git a/ChangeLog b/ChangeLog
index 77e33b4..2e10f47 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Sep 12 17:24:11 CEST 2003 Daniel Veillard <daniel@veillard.com>
+
+ * xpath.c: fix a problem with strcpy() in xmlXPathFormatNumber()
+ valgrind pointed out the strings overlapped. cleanup .
+
Fri Sep 12 11:43:12 CEST 2003 Daniel Veillard <daniel@veillard.com>
* tree.c: applied speedup to xmlSearchNs() as suggested by
diff --git a/xpath.c b/xpath.c
index 2e0c9eb..7946fd6 100644
--- a/xpath.c
+++ b/xpath.c
@@ -1231,7 +1231,7 @@
;
if (*ptr != '.')
ptr++;
- strcpy(ptr, after_fraction);
+ while ((*ptr++ = *after_fraction++) != 0);
/* Finally copy result back to caller */
size = strlen(work) + 1;
@@ -1239,7 +1239,7 @@
work[buffersize - 1] = 0;
size = buffersize;
}
- memcpy(buffer, work, size);
+ memmove(buffer, work, size);
}
break;
}