Sway IPC: fix socket path discovery
Ensure to only read actual "sway --get-socketpath" output, not subsequent garbage in buffer.
This commit is contained in:
@@ -45,7 +45,7 @@ const std::string Ipc::getSocketPath() const {
|
|||||||
throw std::runtime_error("Failed to get socket path");
|
throw std::runtime_error("Failed to get socket path");
|
||||||
}
|
}
|
||||||
while (fgets(buf, sizeof(buf), in) != nullptr) {
|
while (fgets(buf, sizeof(buf), in) != nullptr) {
|
||||||
str_buf.append(buf, sizeof(buf));
|
str_buf.append(buf);
|
||||||
}
|
}
|
||||||
pclose(in);
|
pclose(in);
|
||||||
str = str_buf;
|
str = str_buf;
|
||||||
|
|||||||
Reference in New Issue
Block a user