Merge pull request #108 from Shatur95/use-qstrncpy

Fixes an MSVC C4996 warning that suggests using `strncpy_s`.
This commit is contained in:
Itay Grudev 2020-07-02 03:14:01 +01:00 committed by GitHub
commit 6c08403cad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;