Commit 2b759b84 authored by topjohnwu's avatar topjohnwu

Properly reset string

parent 1e45c63e
...@@ -90,6 +90,7 @@ void update_uid_map() { ...@@ -90,6 +90,7 @@ void update_uid_map() {
size_t len = data_path.length(); size_t len = data_path.length();
auto dir = open_dir(APP_DATA_DIR); auto dir = open_dir(APP_DATA_DIR);
for (dirent *entry; (entry = xreaddir(dir.get()));) { for (dirent *entry; (entry = xreaddir(dir.get()));) {
data_path.resize(len);
data_path += '/'; data_path += '/';
data_path += entry->d_name; data_path += entry->d_name;
data_path += '/'; data_path += '/';
...@@ -102,8 +103,6 @@ void update_uid_map() { ...@@ -102,8 +103,6 @@ void update_uid_map() {
continue; continue;
uid_proc_map[st.st_uid].emplace_back(hide.second); uid_proc_map[st.st_uid].emplace_back(hide.second);
} }
// Reset string
data_path.resize(len);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment