diff options
Diffstat (limited to 'src/path.cc')
| -rw-r--r-- | src/path.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/path.cc b/src/path.cc index 3ab8c0c..103e2c5 100644 --- a/src/path.cc +++ b/src/path.cc @@ -31,8 +31,7 @@ string path_unifier(const string &s, bool is_cmd) // single word, use path if (is_cmd && (s.find("/") == string::npos)) { - const char *path_p = getenv("PATH"); - string path = (path_p != nullptr) ? path_p : ""; + string path = safe_str(getenv("PATH")); size_t i = 0, j = 0, l = path.size(); while (true) { @@ -65,7 +64,7 @@ int set_current_dir(const string &s) string get_current_dir() { char buf[MAXLINE]; - return (string)(getcwd(buf, MAXLINE)); + return safe_str(getcwd(buf, MAXLINE)); } |
