Commit 56571185 by iowa\cschwarz

add additional check on fullSize

parent 70187f42
......@@ -2,7 +2,7 @@
///
// DAQ low level IO Library
//
// $Id: DaqFileIO.cxx,v 1.22 2016/04/19 20:53:03 iowa\cschwarz Exp $
// $Id: DaqFileIO.cxx,v 1.23 2016/04/19 21:05:50 iowa\cschwarz Exp $
// Date: March, 2005
// Author: Yiannis Papelis
//
......@@ -1303,7 +1303,7 @@ CDaqLowLevelIo::LowLevelDataRead(
// The shorter storage used in the DAQ is transparent to the user so we fill
// the rest of the space (that didn't get read from the file with zeros.
int fullSize = ch.GetRecSize();
if ( fullSize != size ) {
if ( fullSize != size && size < fullSize ) {
memset(((char *)pTempSpace) + size, 0, fullSize - size);
}
daqBuf.Append(pTempSpace, fullSize, ch.GetItemCount());
......@@ -1967,7 +1967,7 @@ CDaqLowLevelIo::ReadChannelDataForOneFrame(
}
int fullSize = ch.GetRecSize();
if ( fullSize != size ) {
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