mirror of
https://github.com/mapnik/mapnik.git
synced 2025-12-08 20:13:09 +00:00
check return value from std::fread
This commit is contained in:
parent
bfc7ad397a
commit
a220bda05d
@ -83,11 +83,8 @@ public:
|
||||
if (!size_) return nullptr;
|
||||
std::fseek(file_.get(), 0, SEEK_SET);
|
||||
data_type buffer(new char[size_]);
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunknown-pragmas"
|
||||
#pragma GCC diagnostic ignored "-Wunused-result"
|
||||
std::fread(buffer.get(), size_, 1, file_.get());
|
||||
#pragma GCC diagnostic pop
|
||||
auto count = std::fread(buffer.get(), size_, 1, file_.get());
|
||||
if (count != 1) return nullptr;
|
||||
return buffer;
|
||||
}
|
||||
private:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user