From 6698793a241a3acfa2c2193ba363f5041b4ec22b Mon Sep 17 00:00:00 2001 From: iZsh Date: Sun, 16 Aug 2015 14:42:18 +0200 Subject: Fix issue #112 (copy messages instead of modifying the input msg) --- lib/decoding/control_channels_decoder_impl.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'lib/decoding/control_channels_decoder_impl.cc') diff --git a/lib/decoding/control_channels_decoder_impl.cc b/lib/decoding/control_channels_decoder_impl.cc index 3ea3fd9..1d25664 100644 --- a/lib/decoding/control_channels_decoder_impl.cc +++ b/lib/decoding/control_channels_decoder_impl.cc @@ -137,13 +137,10 @@ namespace gr { //send message with header of the first burst pmt::pmt_t first_header_plus_burst = pmt::cdr(d_bursts[0]); gsmtap_hdr * header = (gsmtap_hdr *)pmt::blob_data(first_header_plus_burst); - header->type = GSMTAP_TYPE_UM; - - int8_t * header_content = (int8_t *)header; - int8_t header_plus_data[sizeof(gsmtap_hdr)+DATA_BYTES]; - memcpy(header_plus_data, header_content, sizeof(gsmtap_hdr)); + memcpy(header_plus_data, header, sizeof(gsmtap_hdr)); memcpy(header_plus_data+sizeof(gsmtap_hdr), outmsg, DATA_BYTES); + ((gsmtap_hdr*)header_plus_data)->type = GSMTAP_TYPE_UM; pmt::pmt_t msg_binary_blob = pmt::make_blob(header_plus_data,DATA_BYTES+sizeof(gsmtap_hdr)); pmt::pmt_t msg_out = pmt::cons(pmt::PMT_NIL, msg_binary_blob); -- cgit v1.2.3