diff options
author | Cedric Nugteren <web@cedricnugteren.nl> | 2017-09-16 21:26:38 +0200 |
---|---|---|
committer | Cedric Nugteren <web@cedricnugteren.nl> | 2017-09-16 21:26:38 +0200 |
commit | a23cd8d13a27fe7cea81cc8960e4b36bef023515 (patch) | |
tree | 2e3e142090f0641a3aa8947ffcbaff71488a7968 /src | |
parent | 0802e3d84c464f2f1dd9a02ea353654d19c2286a (diff) |
Updated README with proper AMD device names; fixed device look-up for names of length 50+
Diffstat (limited to 'src')
-rw-r--r-- | src/database/database.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/database/database.cpp b/src/database/database.cpp index 4187ffe3..64306c7b 100644 --- a/src/database/database.cpp +++ b/src/database/database.cpp @@ -199,8 +199,10 @@ database::Parameters Database::SearchDevice(const std::string &target_device, const std::vector<std::string> ¶meter_names) const { for (auto &device: devices) { const auto device_name = CharArrayToString(device.name); - if (device_name == target_device) { - log_debug("Found parameters for device type '" + target_device + "'"); + // Cuts off 'target_device' string at 50 since the database cuts off as well + const auto target_device_cut_off = (target_device.length() > 50) ? target_device.substr(0, 50) : target_device; + if (device_name == target_device_cut_off) { + log_debug("Found parameters for device type '" + target_device_cut_off + "'"); // Sets the parameters accordingly auto parameters = database::Parameters(); |