Skip to content

Commit

Permalink
Fix compilation error in sys/mem on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
nabijaczleweli committed Jun 6, 2016
1 parent 4ddda94 commit 3248e9d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/system/memory/non-windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ iware::system::memory_t iware::system::memory() noexcept {
std::ifstream meminfo("/proc/meminfo");

if(!meminfo.is_open() || !meminfo)
return ret;
return {};

iware::system::memory_t ret;
for(std::string line; std::getline(meminfo, line);) {
const auto colon_id = line.find_first_of(':');
const auto value = std::strtoul(line.c_str() + colon_id + 1, nullptr) * 1024;
const auto value = std::strtoul(line.c_str() + colon_id + 1, nullptr, 10) * 1024;

if(line.find("MemTotal") == 0)
ret.physical_total = value;
Expand Down

0 comments on commit 3248e9d

Please sign in to comment.