Remove warnings
[anna.git] / source / diameter / helpers / ericsson / functions.cpp
index 77b899a..9c65681 100644 (file)
@@ -29,13 +29,14 @@ std::string anna::diameter::helpers::ericsson::functions::getSCAPSubscriptionIdD
   if(db.getSize() < Message::HeaderLength)
     throw anna::RuntimeException("Not enough bytes to cover command header length", ANNA_FILE_LOCATION);
 
-  anna::DataBlock avpsDB(db.getData() + Message::HeaderLength, db.getSize() - Message::HeaderLength);
+  //anna::DataBlock avpsDB(db.getData() + Message::HeaderLength, db.getSize() - Message::HeaderLength);
+  const char *avpsDB = db.getData() + Message::HeaderLength;
+  int avpsLen = db.getSize() - Message::HeaderLength;
   std::string result = "";
   bool found = false;
   int pos = 1; // first avp
   const char * subscriptionIdPtr;
   const char * subscriptionIdDataPtr;
-  int type;
   // Decoded avp information:
   AvpId _id;
   char _flags;
@@ -43,7 +44,8 @@ std::string anna::diameter::helpers::ericsson::functions::getSCAPSubscriptionIdD
   std::string _dataG /* grouped */, _data;
 
   while(!found) {
-    subscriptionIdPtr = anna::diameter::codec::functions::findAVP(avpsDB, AVPID__SCAP_Subscription_Id, pos);
+    //subscriptionIdPtr = anna::diameter::codec::functions::findAVP(avpsDB, AVPID__SCAP_Subscription_Id, pos);
+    subscriptionIdPtr = anna::diameter::codec::functions::findAVP(avpsDB, avpsLen, AVPID__SCAP_Subscription_Id, pos);
 
     if(!subscriptionIdPtr) return result;