summaryrefslogtreecommitdiff
path: root/src/MTS_IO_MccMncTable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/MTS_IO_MccMncTable.cpp')
-rw-r--r--src/MTS_IO_MccMncTable.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/MTS_IO_MccMncTable.cpp b/src/MTS_IO_MccMncTable.cpp
index e375213..b187b86 100644
--- a/src/MTS_IO_MccMncTable.cpp
+++ b/src/MTS_IO_MccMncTable.cpp
@@ -53,9 +53,13 @@ MccMncTable::MccMncTable() {
Json::Value MccMncTable::lookup(const std::string& sMcc, const std::string& sMnc) {
uint32_t iMcc, iMnc;
+ std::string sNormalizedMnc = sMnc;
printTrace("[MCCMNC] MCCx[%s] MNCx[%s]", sMcc.c_str(), sMnc.c_str());
- if(!MTS::Text::parseHex(iMcc, sMcc)) { return Json::Value::null; }
- if(!MTS::Text::parseHex(iMnc, sMnc)) { return Json::Value::null; }
+ if (sMnc.length() == 2) {
+ sNormalizedMnc += 'f';
+ }
+ if (!MTS::Text::parseHex(iMcc, sMcc)) { return Json::Value::null; }
+ if (!MTS::Text::parseHex(iMnc, sNormalizedMnc)) { return Json::Value::null; }
printTrace("[MCCMNC] MCC0X[%d] MNC0X[%d]", iMcc, iMnc);
if (m_mTable.count(iMcc)) {
if(m_mTable[iMcc].count(iMnc)) {