diff options
author | Johnathan Corgan | 2013-02-21 15:32:06 -0800 |
---|---|---|
committer | Johnathan Corgan | 2013-02-21 15:32:06 -0800 |
commit | e7e219cde48347fbaf8849fcb820212893272a2e (patch) | |
tree | 78fdb87b72242162b5a35a9407d0d096d756ca28 /gnuradio-core/src/lib | |
parent | 09e9930479712d8760011346c43009ebdecd3df8 (diff) | |
parent | b781ad0a911e042a06efa5881bd9c3b8e789edcc (diff) | |
download | gnuradio-e7e219cde48347fbaf8849fcb820212893272a2e.tar.gz gnuradio-e7e219cde48347fbaf8849fcb820212893272a2e.tar.bz2 gnuradio-e7e219cde48347fbaf8849fcb820212893272a2e.zip |
Merge remote-tracking branch 'ncorgan/random_pdu_fix'
Diffstat (limited to 'gnuradio-core/src/lib')
-rw-r--r-- | gnuradio-core/src/lib/general/gr_random_pdu.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gnuradio-core/src/lib/general/gr_random_pdu.cc b/gnuradio-core/src/lib/general/gr_random_pdu.cc index 9f692c72b..6d8c13614 100644 --- a/gnuradio-core/src/lib/general/gr_random_pdu.cc +++ b/gnuradio-core/src/lib/general/gr_random_pdu.cc @@ -34,6 +34,7 @@ #include <stdexcept> #include <string.h> #include <iostream> +#include <vector> // public constructor that returns a shared_ptr @@ -68,13 +69,13 @@ void gr_random_pdu::output_random(){ int len = rvar(); // fill it with random bytes - unsigned char vec[len]; + std::vector<unsigned char> vec; for(int i=0; i<len; i++){ - vec[i] = (unsigned char) bvar(); + vec.push_back((unsigned char) bvar()); } // send the vector - pmt::pmt_t vecpmt( pmt::pmt_make_blob( vec, len ) ); + pmt::pmt_t vecpmt( pmt::pmt_make_blob( &vec[0], len ) ); pmt::pmt_t pdu( pmt::pmt_cons( pmt::PMT_NIL, vecpmt ) ); message_port_pub( pmt::mp("pdus"), pdu ); |