Merge Dirk Zimoch's fix_zero_size_arrays branch

This commit is contained in:
Andrew Johnson
2020-10-29 17:07:35 -05:00
12 changed files with 106 additions and 42 deletions
+1 -1
View File
@@ -517,7 +517,7 @@ struct dbr_ctrl_double{
};
#define dbr_size_n(TYPE,COUNT)\
((unsigned)((COUNT)<=0?dbr_size[TYPE]:dbr_size[TYPE]+((COUNT)-1)*dbr_value_size[TYPE]))
((unsigned)((COUNT)<0?dbr_size[TYPE]:dbr_size[TYPE]+((COUNT)-1)*dbr_value_size[TYPE]))
/* size for each type - array indexed by the DBR_ type code */
LIBCA_API extern const unsigned short dbr_size[];
+2 -2
View File
@@ -329,7 +329,7 @@ void nciu::write (
if ( ! this->accessRightState.writePermit() ) {
throw cacChannel::noWriteAccess();
}
if ( countIn > this->count || countIn == 0 ) {
if ( countIn > this->count) {
throw cacChannel::outOfBounds();
}
if ( type == DBR_STRING ) {
@@ -350,7 +350,7 @@ cacChannel::ioStatus nciu::write (
if ( ! this->accessRightState.writePermit() ) {
throw cacChannel::noWriteAccess();
}
if ( countIn > this->count || countIn == 0 ) {
if ( countIn > this->count) {
throw cacChannel::outOfBounds();
}
if ( type == DBR_STRING ) {