From 528f9620e3647c1dac11ebe5dc199c2855fb2869 Mon Sep 17 00:00:00 2001 From: Uwe Seimet Date: Sat, 28 Aug 2021 14:40:39 +0200 Subject: [PATCH] Removed magic constant --- src/raspberrypi/rasctl.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/raspberrypi/rasctl.cpp b/src/raspberrypi/rasctl.cpp index 72e4e53b..0ab45b0e 100644 --- a/src/raspberrypi/rasctl.cpp +++ b/src/raspberrypi/rasctl.cpp @@ -20,6 +20,9 @@ #include #include +// Separator for the INQUIRY name components +#define COMPONENT_SEPARATOR ':' + using namespace std; using namespace rascsi_interface; @@ -452,11 +455,11 @@ int main(int argc, char* argv[]) string revision; string s = optarg; - size_t separatorPos = s.find(':'); + size_t separatorPos = s.find(COMPONENT_SEPARATOR); if (separatorPos != string::npos) { vendor = s.substr(0, separatorPos); s = s.substr(separatorPos + 1); - separatorPos = s.find(':'); + separatorPos = s.find(COMPONENT_SEPARATOR); if (separatorPos != string::npos) { product = s.substr(0, separatorPos); revision = s.substr(separatorPos + 1);