Removed magic constant

This commit is contained in:
Uwe Seimet 2021-08-28 14:40:39 +02:00
parent 095157ccbe
commit 528f9620e3

View File

@ -20,6 +20,9 @@
#include <iostream> #include <iostream>
#include <list> #include <list>
// Separator for the INQUIRY name components
#define COMPONENT_SEPARATOR ':'
using namespace std; using namespace std;
using namespace rascsi_interface; using namespace rascsi_interface;
@ -452,11 +455,11 @@ int main(int argc, char* argv[])
string revision; string revision;
string s = optarg; string s = optarg;
size_t separatorPos = s.find(':'); size_t separatorPos = s.find(COMPONENT_SEPARATOR);
if (separatorPos != string::npos) { if (separatorPos != string::npos) {
vendor = s.substr(0, separatorPos); vendor = s.substr(0, separatorPos);
s = s.substr(separatorPos + 1); s = s.substr(separatorPos + 1);
separatorPos = s.find(':'); separatorPos = s.find(COMPONENT_SEPARATOR);
if (separatorPos != string::npos) { if (separatorPos != string::npos) {
product = s.substr(0, separatorPos); product = s.substr(0, separatorPos);
revision = s.substr(separatorPos + 1); revision = s.substr(separatorPos + 1);