From 3f36594f1edf828f32869b7ae7f0252283b4a651 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Tue, 16 Oct 2018 14:20:21 +0200 Subject: [PATCH] fix copy ctors in bit_buffer_t --- lib/include/srslte/common/common.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/include/srslte/common/common.h b/lib/include/srslte/common/common.h index eb157f368..e44f115ef 100644 --- a/lib/include/srslte/common/common.h +++ b/lib/include/srslte/common/common.h @@ -216,13 +216,16 @@ struct bit_buffer_t{ #endif } bit_buffer_t(const bit_buffer_t& buf){ + msg = &buffer[SRSLTE_BUFFER_HEADER_OFFSET]; N_bits = buf.N_bits; memcpy(msg, buf.msg, N_bits); } bit_buffer_t & operator= (const bit_buffer_t & buf){ // avoid self assignment - if (&buf == this) + if (&buf == this) { return *this; + } + msg = &buffer[SRSLTE_BUFFER_HEADER_OFFSET]; N_bits = buf.N_bits; memcpy(msg, buf.msg, N_bits); return *this;