1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-14 12:10:34 +00:00

Remove delete

This commit is contained in:
Carles Fernandez 2019-07-01 15:26:48 +02:00
parent 587ec66e78
commit 54553a8cff

View File

@ -39,10 +39,10 @@
#include <glog/logging.h>
#include <pugixml.hpp>
#include <cmath> // for pow
#include <cstring> // for strcpy
#include <exception> // for exception
#include <iostream> // for cerr
#include <utility> // for pair
#include <vector>
Gnss_Sdr_Supl_Client::Gnss_Sdr_Supl_Client()
{
@ -173,14 +173,16 @@ int Gnss_Sdr_Supl_Client::get_assistance(int i_mcc, int i_mns, int i_lac, int i_
supl_set_gsm_cell(&ctx, mcc, mns, lac, ci);
// PERFORM SUPL COMMUNICATION
char* cstr = new char[server_name.length() + 1];
strcpy(cstr, server_name.c_str());
std::vector<char> cstr(server_name.length() + 1);
for (int i = 0; i != server_name.length(); ++i)
{
cstr[i] = static_cast<char>(server_name[i]);
}
int err;
ctx.p.request = request; // select assistance info request from a pre-defined set
//std::cout<<"mcc="<<mcc<<"mns="<<mns<<"lac="<<lac<<"ci="<<ci<<std::endl;
err = supl_get_assist(&ctx, cstr, &assist);
err = supl_get_assist(&ctx, cstr.data(), &assist);
if (err == 0)
{
read_supl_data();
@ -196,7 +198,6 @@ int Gnss_Sdr_Supl_Client::get_assistance(int i_mcc, int i_mns, int i_lac, int i_
*/
supl_close(&ctx);
}
delete[] cstr;
return err;
}