--- a/src/corelib/tools/qbytearray.cpp Tue Jul 06 15:10:48 2010 +0300
+++ b/src/corelib/tools/qbytearray.cpp Wed Aug 18 10:37:55 2010 +0300
@@ -1805,6 +1805,11 @@
/*! \fn QByteArray &QByteArray::replace(int pos, int len, const char *after)
\overload
+
+ Replaces \a len bytes from index position \a pos with the zero terminated
+ string \a after.
+
+ Notice: this can change the lenght of the byte array.
*/
QByteArray &QByteArray::replace(int pos, int len, const char *after)
{
@@ -2147,18 +2152,18 @@
if (result.d->alloc != resultSize)
return QByteArray(); // not enough memory
- qMemCopy(result.d->data, d->data, d->size);
+ memcpy(result.d->data, d->data, d->size);
int sizeSoFar = d->size;
char *end = result.d->data + sizeSoFar;
const int halfResultSize = resultSize >> 1;
while (sizeSoFar <= halfResultSize) {
- qMemCopy(end, result.d->data, sizeSoFar);
+ memcpy(end, result.d->data, sizeSoFar);
end += sizeSoFar;
sizeSoFar <<= 1;
}
- qMemCopy(end, result.d->data, resultSize - sizeSoFar);
+ memcpy(end, result.d->data, resultSize - sizeSoFar);
result.d->data[resultSize] = '\0';
result.d->size = resultSize;
return result;