summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qbytearray.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-09-15 19:47:57 +0200
committerLiang Qi <liang.qi@qt.io>2016-09-15 19:47:57 +0200
commit40a1f69e8663fb79560c26cfad5ead45b1b3ee5f (patch)
treea8ceb093a098a38b29c0fe27e41af480ae10b876 /src/corelib/tools/qbytearray.cpp
parent446afc10451d5097d7bd20b1b8d20325c4d54fa5 (diff)
parent6b2071c697d4c48f0cd289b28b443ebffc3432e6 (diff)
Merge remote-tracking branch 'origin/5.8' into dev
Conflicts: configure.json mkspecs/macx-tvos-clang/qmake.conf mkspecs/macx-watchos-clang/qmake.conf Change-Id: Iaf32339ace59dff9ed344972472744c55d75025c
Diffstat (limited to 'src/corelib/tools/qbytearray.cpp')
-rw-r--r--src/corelib/tools/qbytearray.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index 71bbd80980..7d9c5dc325 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -303,13 +303,14 @@ char *qstrncpy(char *dst, const char *src, uint len)
{
if (!src || !dst)
return 0;
+ if (len > 0) {
#if defined(_MSC_VER) && _MSC_VER >= 1400
- strncpy_s(dst, len, src, len-1);
+ strncpy_s(dst, len, src, len - 1);
#else
- strncpy(dst, src, len);
+ strncpy(dst, src, len);
#endif
- if (len > 0)
dst[len-1] = '\0';
+ }
return dst;
}