Commit 7d210699 by iowa\dheitbri

added check to make sure we are not trying to grab more data than we have space for.

parent d8b41d9b
......@@ -2,7 +2,7 @@
///
// DAQ low level IO Library
//
// $Id: DaqFileIO.cxx,v 1.15 2010/05/03 17:25:45 iowa\dheitbri Exp $
// $Id: DaqFileIO.cxx,v 1.16 2011/06/20 14:36:30 iowa\dheitbri Exp $
// Date: March, 2005
// Author: Yiannis Papelis
//
......@@ -206,7 +206,7 @@ CDaqLowLevelIo::FrameDropped(int frm)
}
int CDaqLowLevelIo::GetDroppedFrames() const {
return m_DroppedFrames.size();
return (int)m_DroppedFrames.size();
}
/////////////////////////////////////////////////////////////////////////////
///
......@@ -1878,7 +1878,10 @@ CDaqLowLevelIo::ReadDataForOneFrame(
}
int fullSize = ch.GetRecSize();
if ( fullSize != size ) {
if (size < fullSize){
size = fullSize;
}
if ( fullSize != size && size < fullSize ) {
memset(((char *)pTempSpace) + size, 0, fullSize - size);
}
daqBuf.Replace(pTempSpace, fullSize, ch.GetItemCount());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment