1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-30 22:43:14 +03:00

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

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