Change-Id: I24e2d2d6b6ecb3e3daf0edd94fe67866f369e87a
}
if (fseek(fp, 0, SEEK_END)) {
+ fclose(fp);
throw std::runtime_error(std::string("Failed to fseek end of file").c_str());
}
long fsize = ftell(fp);
if (fsize < 0) {
+ fclose(fp);
throw std::runtime_error(std::string("Failed to ftell").c_str());
}
if (fsize > (MAX_CONF_SIZE)) {
+ fclose(fp);
throw std::runtime_error(std::string("File size over ").append(std::to_string(MAX_CONF_SIZE)).append("Bytes").c_str());
}
if (fseek(fp, 0, SEEK_SET)) {
+ fclose(fp);
throw std::runtime_error(std::string("Failed to fseek beginning of file").c_str());
}