mirror of https://github.com/PentHertz/srsLTE.git
fixing snprintf issue where return value was used for length calculation
This commit is contained in:
parent
1155adf007
commit
8f419c035b
|
@ -572,12 +572,13 @@ void rrc::sort_neighbour_cells()
|
|||
neighbour_cells[0]->phy_cell.cell.id,
|
||||
neighbour_cells[0]->get_rsrp());
|
||||
for (uint32_t i = 1; i < neighbour_cells.size(); i++) {
|
||||
n += snprintf(&ordered[n],
|
||||
512 - n,
|
||||
" | earfcn=%d, pci=%d, rsrp=%.2f",
|
||||
neighbour_cells[i]->get_earfcn(),
|
||||
neighbour_cells[i]->get_pci(),
|
||||
neighbour_cells[i]->get_rsrp());
|
||||
int m = snprintf(&ordered[n],
|
||||
512 - n,
|
||||
" | earfcn=%d, pci=%d, rsrp=%.2f",
|
||||
neighbour_cells[i]->get_earfcn(),
|
||||
neighbour_cells[i]->get_pci(),
|
||||
neighbour_cells[i]->get_rsrp());
|
||||
n += m;
|
||||
}
|
||||
rrc_log->info("Neighbours: %s]\n", ordered);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue