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
This commit is contained in:
Daniel Veillard 2003-09-12 15:32:16 +00:00
parent 2a3fea37e1
commit 5dd3c9622a
2 changed files with 7 additions and 2 deletions

View File

@ -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

View File

@ -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;
}