Skip to content

Commit

Permalink
fix log restore
Browse files Browse the repository at this point in the history
  • Loading branch information
sinev-valentine committed Mar 26, 2019
1 parent 5bdbfc0 commit 8fdcc2d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion keychain_lib/src/keydata_singleton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ void keydata::restore(const char * filename, std::string& mnemonics, std::string
file.getline(buf, buf_size);
if (file.eof() || !file.good())
break;
json.push_back(std::string(buf, buf_size));
json.push_back(std::string(buf, file.gcount()-1));
BOOST_LOG_SEV(log.lg, info) << "restore path: " << json.back();
}

Expand Down
6 changes: 4 additions & 2 deletions keychain_linux/passentry_cmd/pass_entry_term.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,12 @@ std::list<std::string> pass_entry_term::parse_device_file()
const int buf_size = 1000;
char buf[buf_size];

while(!f_dev.eof())
while(true)
{
f_dev.getline(buf, buf_size);
std::string line(buf);
if (f_dev.eof() || !f_dev.good())
break;
std::string line(buf, f_dev.gcount()-1);
std::regex rx("H: Handlers=.*kbd.* event[0-9]+");
std::regex_match(line.begin(), line.end(), rx);
if (std::regex_search(line.begin(), line.end(), rx) )
Expand Down

0 comments on commit 8fdcc2d

Please sign in to comment.