diff --git a/src/wimax/model/snr-to-block-error-rate-manager.cc b/src/wimax/model/snr-to-block-error-rate-manager.cc index 41ff60942..ec340211e 100644 --- a/src/wimax/model/snr-to-block-error-rate-manager.cc +++ b/src/wimax/model/snr-to-block-error-rate-manager.cc @@ -24,6 +24,7 @@ #include "ns3/snr-to-block-error-rate-record.h" #include "default-traces.h" #include "ns3/log.h" +#include "ns3/assert.h" #include NS_LOG_COMPONENT_DEFINE ("SNRToBlockErrorRateManager"); @@ -273,6 +274,8 @@ SNRToBlockErrorRateManager::ReLoadTraces (void) void SNRToBlockErrorRateManager::SetTraceFilePath (char *traceFilePath) { + NS_ASSERT_MSG (std::strlen (traceFilePath) < TRACE_FILE_PATH_SIZE, + "char * traceFilePath too long"); std::strcpy (m_traceFilePath, traceFilePath); } diff --git a/src/wimax/model/snr-to-block-error-rate-manager.h b/src/wimax/model/snr-to-block-error-rate-manager.h index e3e6915a5..8201a8be8 100644 --- a/src/wimax/model/snr-to-block-error-rate-manager.h +++ b/src/wimax/model/snr-to-block-error-rate-manager.h @@ -94,7 +94,8 @@ private: void ClearRecords (void); double m_speed; // in m/s uint8_t m_activateLoss; - char m_traceFilePath[1024]; + static const unsigned int TRACE_FILE_PATH_SIZE = 1024; + char m_traceFilePath[TRACE_FILE_PATH_SIZE]; std::vector * m_recordModulation[7];