mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2025-05-20 07:26:58 -04:00
Binary paths array was wrongly iterated up to binaryPaths->length(), which is actually a length of the first string in array, not the array length itself. Rewriting array into a list, so that it could be iterated automatically, without explicitly providing an index range
This commit is contained in:
@@ -34,9 +34,9 @@ GPService::~GPService()
|
||||
|
||||
QString GPService::findBinary()
|
||||
{
|
||||
for (int i = 0; i < binaryPaths->length(); i++) {
|
||||
if (QFileInfo::exists(binaryPaths[i])) {
|
||||
return binaryPaths[i];
|
||||
for (auto& binaryPath : binaryPaths) {
|
||||
if (QFileInfo::exists(binaryPath)) {
|
||||
return binaryPath;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
|
||||
Reference in New Issue
Block a user