diff options
author | Itay Grudev <itay+github.com@grudev.com> | 2020-07-02 03:14:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-02 03:14:01 +0100 |
commit | 6c08403cadbcbba7145d5ec3cfa4f616460f14c2 (patch) | |
tree | 50ce9116be5ccae6abf28f29d260bdcb92ea5cb2 | |
parent | Restored state as it was before install-qt-action#38 (diff) | |
parent | Use qstrncpy (diff) | |
download | singleapplication-6c08403cadbcbba7145d5ec3cfa4f616460f14c2.tar.xz |
Merge pull request #108 from Shatur95/use-qstrncpy
Fixes an MSVC C4996 warning that suggests using `strncpy_s`.
-rw-r--r-- | singleapplication_p.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/singleapplication_p.cpp b/singleapplication_p.cpp index 705609f..891f5a0 100644 --- a/singleapplication_p.cpp +++ b/singleapplication_p.cpp @@ -187,8 +187,7 @@ void SingleApplicationPrivate::startPrimary() inst->primary = true; inst->primaryPid = q->applicationPid(); - strncpy( inst->primaryUser, getUsername().toUtf8().data(), 127 ); - inst->primaryUser[127] = '\0'; + qstrncpy( inst->primaryUser, getUsername().toUtf8().data(), sizeof(inst->primaryUser) ); inst->checksum = blockChecksum(); instanceNumber = 0; |