Use qstrncpy

Fixes MSVC C4996 warning.
This commit is contained in:
Shatur95 2020-07-02 02:36:54 +03:00
parent bae7c331ca
commit c5042727ae

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;