mirror of https://github.com/PentHertz/srsLTE.git
fix byte_buffer copy and assignment ctor
This commit is contained in:
parent
601b2a357b
commit
1985d7b37c
|
@ -125,7 +125,7 @@ public:
|
||||||
#ifdef ENABLE_TIMESTAMP
|
#ifdef ENABLE_TIMESTAMP
|
||||||
timestamp_is_set = false;
|
timestamp_is_set = false;
|
||||||
#endif
|
#endif
|
||||||
msg = &buffer[SRSLTE_BUFFER_HEADER_OFFSET];
|
msg = &buffer[SRSLTE_BUFFER_HEADER_OFFSET];
|
||||||
next = NULL;
|
next = NULL;
|
||||||
#ifdef SRSLTE_BUFFER_POOL_LOG_ENABLED
|
#ifdef SRSLTE_BUFFER_POOL_LOG_ENABLED
|
||||||
bzero(debug_name, SRSLTE_BUFFER_POOL_LOG_NAME_LEN);
|
bzero(debug_name, SRSLTE_BUFFER_POOL_LOG_NAME_LEN);
|
||||||
|
@ -134,6 +134,9 @@ public:
|
||||||
byte_buffer_t(const byte_buffer_t& buf)
|
byte_buffer_t(const byte_buffer_t& buf)
|
||||||
{
|
{
|
||||||
bzero(buffer, SRSLTE_MAX_BUFFER_SIZE_BYTES);
|
bzero(buffer, SRSLTE_MAX_BUFFER_SIZE_BYTES);
|
||||||
|
msg = &buffer[SRSLTE_BUFFER_HEADER_OFFSET];
|
||||||
|
next = NULL;
|
||||||
|
// copy actual contents
|
||||||
N_bytes = buf.N_bytes;
|
N_bytes = buf.N_bytes;
|
||||||
memcpy(msg, buf.msg, N_bytes);
|
memcpy(msg, buf.msg, N_bytes);
|
||||||
}
|
}
|
||||||
|
@ -143,6 +146,8 @@ public:
|
||||||
if (&buf == this)
|
if (&buf == this)
|
||||||
return *this;
|
return *this;
|
||||||
bzero(buffer, SRSLTE_MAX_BUFFER_SIZE_BYTES);
|
bzero(buffer, SRSLTE_MAX_BUFFER_SIZE_BYTES);
|
||||||
|
msg = &buffer[SRSLTE_BUFFER_HEADER_OFFSET];
|
||||||
|
next = NULL;
|
||||||
N_bytes = buf.N_bytes;
|
N_bytes = buf.N_bytes;
|
||||||
memcpy(msg, buf.msg, N_bytes);
|
memcpy(msg, buf.msg, N_bytes);
|
||||||
return *this;
|
return *this;
|
||||||
|
|
Loading…
Reference in New Issue