summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Hartmann <aha_1980@gmx.de>2018-04-20 18:30:21 +0200
committerAndré Hartmann <aha_1980@gmx.de>2018-04-21 06:04:22 +0000
commitbca1d8c38241541d1df031f227280b9d762728ed (patch)
treed230031b6b5056d2100fb0c036ef0e47ac9d15d9
parenta38c46ad852cd7ce376d50aa775590602a60f310 (diff)
QByteArray: Add a note regarding overlapping pointers to qstr(n)cpy
Stated e.g. in http://en.cppreference.com/w/c/string/byte/strcpy Change-Id: I42fd5a5fa6a63b67a7105aa56e93e3d3f2193cf7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--src/corelib/tools/qbytearray.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index 421e716d14..b589f78a28 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -261,6 +261,8 @@ char *qstrdup(const char *src)
This function assumes that \a dst is large enough to hold the
contents of \a src.
+ \note If \a dst and \a src overlap, the behavior is undefined.
+
\sa qstrncpy()
*/
@@ -292,6 +294,8 @@ char *qstrcpy(char *dst, const char *src)
This function assumes that \a dst is at least \a len characters
long.
+ \note If \a dst and \a src overlap, the behavior is undefined.
+
\note When compiling with Visual C++ compiler version 14.00
(Visual C++ 2005) or later, internally the function strncpy_s
will be used.