diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.cc b/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.cc index fec047988..05c1e8bf5 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.cc @@ -71,12 +71,14 @@ void swapEndianness( int8_t const *in, std::vector< int8_t > &out, size_t item_s unsigned int i; unsigned int j = 0; int k = 0; + int l = 0; size_t skip = item_size - 1; for( i = 0; i < ninput_items; ++i ) { k = j + skip; - while( k >= 0 ) + l = j; + while( k >= l ) { out[j++] = in[k--]; }