diff --git a/examples/c++/hmtrp.cxx b/examples/c++/hmtrp.cxx index 84f7995b..3d58ba96 100644 --- a/examples/c++/hmtrp.cxx +++ b/examples/c++/hmtrp.cxx @@ -23,6 +23,7 @@ */ #include +#include #include #include #include "hmtrp.h" @@ -128,7 +129,8 @@ int main (int argc, char **argv) // check to see if data is available first. if (radio->dataAvailable()) { - int rv = radio->readData(radioBuffer, bufferLength); + memset(radioBuffer, 0, bufferLength); + int rv = radio->readData(radioBuffer, bufferLength - 1); if (rv > 0) cout << "Received: " << radioBuffer << endl;