diff options
author | Martin Braun | 2013-02-26 13:44:12 +0100 |
---|---|---|
committer | Martin Braun | 2013-02-26 13:44:12 +0100 |
commit | 7bb8c89e224e7b2c9ddbc5b4f50c79ffb0da2557 (patch) | |
tree | aec6e881cdd825c39a084ce7aa16a87c045a4fae /gnuradio-core/src/lib | |
parent | d7766c2c8d12bbfaf29b83cfea5ff95475b45d86 (diff) | |
parent | a54dc5bab6cc38513e9732be9f5c2670145b160f (diff) | |
download | gnuradio-7bb8c89e224e7b2c9ddbc5b4f50c79ffb0da2557.tar.gz gnuradio-7bb8c89e224e7b2c9ddbc5b4f50c79ffb0da2557.tar.bz2 gnuradio-7bb8c89e224e7b2c9ddbc5b4f50c79ffb0da2557.zip |
Merge branch 'master' of git://github.com/gnuradio/gnuradio into grmodtool
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 ); |