diff --git a/stim/envi/envi.h b/stim/envi/envi.h index 6687b08..cd7e105 100644 --- a/stim/envi/envi.h +++ b/stim/envi/envi.h @@ -359,11 +359,23 @@ public: fseek(f, 9, SEEK_SET); //seek to the number of bands short b; //allocate space for the number of bands - fread(&b, sizeof(short), 1, f); //read the number of bands + size_t nread = fread(&b, sizeof(short), 1, f); //read the number of bands + if(nread != 1){ + std::cout<<"Error reading band number from Agilent file."<