Improvements & fixes
[anna.git] / example / diameter / launcher / main.cpp
index fdb69d3..54fcbdc 100644 (file)
@@ -363,6 +363,14 @@ bool Launcher::getDataBlockFromHexFile(const std::string &pathfile, anna::DataBl
   if(infile.is_open()) {
     infile >> buffer;
     std::string hexString(buffer, strlen(buffer));
+    // Allow colon separator in hex string: we have to remove them before processing with 'fromHexString':
+    hexString.erase(std::remove(hexString.begin(), hexString.end(), ':'), hexString.end());
+    LOGDEBUG(
+      std::string msg = "Hex string (remove colons if exists): ";
+      msg += hexString;
+      anna::Logger::debug(msg, ANNA_FILE_LOCATION);
+    );
+
     anna::functions::fromHexString(hexString, db);
     // Close file
     infile.close();