summaryrefslogtreecommitdiff
path: root/gnuradio-core
diff options
context:
space:
mode:
authorTom Rondeau2013-02-21 20:02:05 -0500
committerTom Rondeau2013-02-21 20:02:05 -0500
commit96583a9009478242c51ecfd7bb4321ed3d90e3b8 (patch)
tree95f5b6fc4f8a43aaacda67ff1d700b33516b388f /gnuradio-core
parent2fcf27f95b10d84dbe0e2b36a316c6ed87dc8739 (diff)
parente7e219cde48347fbaf8849fcb820212893272a2e (diff)
downloadgnuradio-96583a9009478242c51ecfd7bb4321ed3d90e3b8.tar.gz
gnuradio-96583a9009478242c51ecfd7bb4321ed3d90e3b8.tar.bz2
gnuradio-96583a9009478242c51ecfd7bb4321ed3d90e3b8.zip
Merge branch 'master' of gnuradio.org:gnuradio
Diffstat (limited to 'gnuradio-core')
-rw-r--r--gnuradio-core/src/lib/general/gr_random_pdu.cc7
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 );