summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2023-02-16 22:28:46 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-03-10 16:10:57 +0000
commit8e50178e020aa5fa9ae5baba31e493db4c20faa9 (patch)
treede022bc9c05aa07fff94030039862d67bc7a68f8
parentfa510dab987abb969e8991615a2b7e380716fdf0 (diff)
downloadqtbase-8e50178e020aa5fa9ae5baba31e493db4c20faa9.tar.gz
qstrncpy(): document that we don't implement strncpy() fill-all-[dst,len)
The Windows version didn't, ever since we started using strncpy_s(), and we might change the non-Windows version, too. Change-Id: Iee1c09674d296be806d4be42b1891940120b4a01 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit cbb484b713f2ed7d1f18d8e9ecbc74d7c59a3c07) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/corelib/text/qbytearray.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/text/qbytearray.cpp b/src/corelib/text/qbytearray.cpp
index d012ae2c27..ba6e79543a 100644
--- a/src/corelib/text/qbytearray.cpp
+++ b/src/corelib/text/qbytearray.cpp
@@ -120,6 +120,10 @@ char *qstrcpy(char *dst, const char *src)
\note If \a dst and \a src overlap, the behavior is undefined.
+ \note Unlike strncpy(), this function does \e not write '\\0' to all \a
+ len bytes of \a dst, but stops after the terminating '\\0'. In this sense,
+ it's similar to C11's strncpy_s().
+
\sa qstrcpy()
*/