memory.cc - fixed typos and missing headers

This commit is contained in:
l0ner 2014-04-14 20:55:00 +02:00
parent 643fef3a7c
commit 5e354b9221

@ -1,7 +1,9 @@
#include <string>
#include <ostream>
#include <sstream>
#include <fstream>
#include "memory.h"
#include "../luts.h"
std::string mem_string( bool use_colors = false ) {
std::ostringstream oss;
@ -20,7 +22,7 @@ std::string mem_string( bool use_colors = false ) {
getline( meminfo_file, mem_line );
substrStart = mem_line.find_first_of( ':' ) + 1;
substrLen = mem_line.find_first_of( 'k' );
total_mem = stoi(mem_line.substr(substrStart, substrLen);
total_mem = stoi(mem_line.substr(substrStart, substrLen));
used_mem = total_mem;
@ -28,7 +30,7 @@ std::string mem_string( bool use_colors = false ) {
getline( meminfo_file, mem_line );
substrStart = mem_line.find_first_of( ':' ) + 1;
substrLen = mem_line.find_first_of( 'k' );
unused_mem = stoi(mem_line.substr(substrStart, substrLen);
unused_mem = stoi(mem_line.substr(substrStart, substrLen));
used_mem -= unused_mem;
}