mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
fix(network): stack-use-after-return found by address sanitizer
Fixes compilation with clang.
This commit is contained in:
parent
9d0842db48
commit
8f9e6c132d
@ -201,8 +201,9 @@ void waybar::modules::Network::worker() {
|
||||
}
|
||||
thread_timer_.sleep_for(interval_);
|
||||
};
|
||||
std::array<struct epoll_event, EPOLL_MAX> events{};
|
||||
thread_ = [this, &events] {
|
||||
thread_ = [this] {
|
||||
std::array<struct epoll_event, EPOLL_MAX> events{};
|
||||
|
||||
int ec = epoll_wait(efd_, events.data(), EPOLL_MAX, -1);
|
||||
if (ec > 0) {
|
||||
for (auto i = 0; i < ec; i++) {
|
||||
|
@ -130,7 +130,8 @@ std::tuple<std::string, std::string> Host::getBusNameAndObjectPath(const std::st
|
||||
}
|
||||
|
||||
void Host::addRegisteredItem(std::string service) {
|
||||
auto [bus_name, object_path] = getBusNameAndObjectPath(service);
|
||||
std::string bus_name, object_path;
|
||||
std::tie(bus_name, object_path) = getBusNameAndObjectPath(service);
|
||||
auto it = std::find_if(items_.begin(), items_.end(), [&bus_name, &object_path](const auto& item) {
|
||||
return bus_name == item->bus_name && object_path == item->object_path;
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user