Skip to content

Commit

Permalink
Merge pull request #164 from forrestv/getline_lvalue
Browse files Browse the repository at this point in the history
Call `std::getline` with an lvalue `std::ifstream` rather than an rvalue
  • Loading branch information
bombela authored Apr 13, 2020
2 parents 1ab8c87 + f66f422 commit 03b4595
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backward.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,8 @@ class TraceResolverLinuxBase

static std::string get_argv0() {
std::string argv0;
std::getline(std::ifstream("/proc/self/cmdline"), argv0, '\0');
std::ifstream ifs("/proc/self/cmdline");
std::getline(ifs, argv0, '\0');
return argv0;
}

Expand Down

0 comments on commit 03b4595

Please sign in to comment.