mirror of
https://github.com/itay-grudev/SingleApplication.git
synced 2025-01-28 06:30:19 +08:00
Merge pull request #108 from Shatur95/use-qstrncpy
Fixes an MSVC C4996 warning that suggests using `strncpy_s`.
This commit is contained in:
commit
6c08403cad
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user