From f7815dab42ee570c38bd7ae85a4f2a6e36803809 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Sun, 28 Apr 2024 20:06:40 +0100 Subject: compositor: more fs safety around tmp directories HIS now includes a random bit, and hyprland will bail if /tmp/hypr is not a directory or if /tmp/hypr/his exists --- hyprctl/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hyprctl/main.cpp') diff --git a/hyprctl/main.cpp b/hyprctl/main.cpp index 3337cbff..9b2c2fd2 100644 --- a/hyprctl/main.cpp +++ b/hyprctl/main.cpp @@ -51,7 +51,7 @@ std::vector instances() { data->id = data->id.substr(data->id.find_last_of('/') + 1, data->id.find(".lock") - data->id.find_last_of('/') - 1); try { - data->time = std::stoull(data->id.substr(data->id.find_first_of('_') + 1)); + data->time = std::stoull(data->id.substr(data->id.find_first_of('_') + 1, data->id.find_last_of('_') - (data->id.find_first_of('_') + 1))); } catch (std::exception& e) { continue; } // read file -- cgit v1.2.3