diff --git a/ChangeLog b/ChangeLog index 77e33b46..2e10f473 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Sep 12 17:24:11 CEST 2003 Daniel Veillard + + * 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 * tree.c: applied speedup to xmlSearchNs() as suggested by diff --git a/xpath.c b/xpath.c index 2e0c9ebf..7946fd67 100644 --- a/xpath.c +++ b/xpath.c @@ -1231,7 +1231,7 @@ xmlXPathFormatNumber(double number, char buffer[], int buffersize) ; 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 @@ xmlXPathFormatNumber(double number, char buffer[], int buffersize) work[buffersize - 1] = 0; size = buffersize; } - memcpy(buffer, work, size); + memmove(buffer, work, size); } break; }