remove usage of std::string for APN

This commit is contained in:
Andre Puschmann 2018-05-01 15:18:35 +02:00
parent 0f6695b9cd
commit 5ac08b62e9
2 changed files with 5 additions and 3 deletions

View File

@ -1145,8 +1145,8 @@ s1ap_nas_transport::handle_esm_information_response(srslte::byte_buffer_t *nas_m
m_s1ap_log->info("ESM Info: EPS bearer id %d\n",esm_info_resp.eps_bearer_id);
if(esm_info_resp.apn_present)
{
m_s1ap_log->info("ESM Info: APN %s\n",esm_info_resp.apn.apn.c_str());
m_s1ap_log->console("ESM Info: APN %s\n",esm_info_resp.apn.apn.c_str());
m_s1ap_log->info("ESM Info: APN %s\n",esm_info_resp.apn.apn);
m_s1ap_log->console("ESM Info: APN %s\n",esm_info_resp.apn.apn);
}
if(esm_info_resp.protocol_cnfg_opts_present)
{

View File

@ -1226,7 +1226,9 @@ void nas::send_esm_information_response(const uint8 proc_transaction_id) {
esm_info_resp.apn_present = false;
} else {
esm_info_resp.apn_present = true;
esm_info_resp.apn.apn = cfg.apn;
int len = std::min((int)cfg.apn.length(), LIBLTE_STRING_LEN);
strncpy(esm_info_resp.apn.apn, cfg.apn.c_str(), len);
esm_info_resp.apn.apn[len - 1] = '\0';
}
esm_info_resp.protocol_cnfg_opts_present = false;