summaryrefslogtreecommitdiffstats
path: root/src/corelib/text
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2023-02-16 22:28:46 +0100
committerMarc Mutz <marc.mutz@qt.io>2023-03-03 18:16:22 +0000
commitcbb484b713f2ed7d1f18d8e9ecbc74d7c59a3c07 (patch)
treeab9bbc669ec2370c92c3982cfa881fed6b576a2e /src/corelib/text
parenteea83bac26294db61fe425da3da498f92145f866 (diff)
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. Pick-to: 6.5 6.4 6.2 5.15 Change-Id: Iee1c09674d296be806d4be42b1891940120b4a01 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/corelib/text')
-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 cd999d28f8..a1ad120520 100644
--- a/src/corelib/text/qbytearray.cpp
+++ b/src/corelib/text/qbytearray.cpp
@@ -123,6 +123,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()
*/