Skip to content
Snippets Groups Projects
Commit db0126dd authored by Stephen A. Wood's avatar Stephen A. Wood Committed by Mark K Jones
Browse files

Exit if an array in parameter file smaller than requested.

parent e5b40a34
No related branches found
No related tags found
1 merge request!16Merge in upstream changes and update CI
......@@ -657,7 +657,11 @@ Int_t THcParmList::ReadArray(const char* attrC, T* array, Int_t size)
}
Int_t sz = var->GetLen();
const void *vp = var->GetValuePointer();
if(size != sz) {
if(size > sz) {
cout << "*** ERROR: requested " << size << " elements of " << attrC <<
" which has only " << sz << " elements" << endl;
exit(EXIT_FAILURE);
} else if(size < sz) {
cout << "*** WARNING: requested " << size << " elements of " << attrC <<
" which has length " << sz << endl;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment