Skip to content

Resplot cppcheck warnings

We check for

if ( xbins.size()==0 || ybins.size()==0 ) { 
      std::cerr << "Resplot::combine() bad limits for histogram: N xbins: " << xbins.size() << "\tN ybins: " << ybins.size() << std::endl;
      return 0;
    }

which is fine

but then propably we should access the entry at 0 after the check e.g if xbins.size()==0 the following could be out of bounds access

std::cout << "x: " << xbins[0] << " - " << xbins.back() << std::endl;

So move the access from before to after the check.

Merge request reports