App: the function findLicense() uses the '==' operator to compare two C strings.

This is wrong and leads to failures under Windows.
This commit is contained in:
wmayer
2023-10-10 13:06:33 +02:00
committed by wwmayer
parent d635a0a034
commit 15622bb519
2 changed files with 18 additions and 2 deletions

View File

@@ -24,6 +24,7 @@
#define APP_LICENSE_H
#include <array>
#include <cstring>
#include <string>
namespace App
@@ -64,8 +65,11 @@ constexpr std::array<TLicenseArr, countOfLicenses> licenseItems {{
int constexpr findLicense(const char* identifier)
{
if (!identifier || identifier[0] == '\0') {
return -1;
}
for (int i = 0; i < countOfLicenses; i++) {
if (licenseItems.at(i).at(posnOfIdentifier) == identifier) {
if (strcmp(licenseItems.at(i).at(posnOfIdentifier), identifier) == 0) {
return i;
}
}