this->size = bitsToWords(this->items * this->item_bits);
usint* buffer = new usint[this->size];
memset(buffer, 0, this->size * sizeof(usint));
- fread(buffer, sizeof(usint), this->size, file);
+ if (fread(buffer, sizeof(usint), this->size, file) != this->size)
+ {
+ std::cerr << "ReadBuffer constructor: Unable to read file" << std::endl;
+ std::exit(1);
+ }
this->data = buffer;
this->reset();
}