Merge pull request #26 from utox39/refactor/use-utils-read-file
refactor(linux-wm): use utils.readFile
This commit is contained in:
@@ -121,9 +121,8 @@ pub fn getWindowManagerInfo(allocator: std.mem.Allocator) ![]const u8 {
|
|||||||
defer file.close();
|
defer file.close();
|
||||||
|
|
||||||
// NOTE: https://stackoverflow.com/questions/23534263/what-is-the-maximum-allowed-limit-on-the-length-of-a-process-name
|
// NOTE: https://stackoverflow.com/questions/23534263/what-is-the-maximum-allowed-limit-on-the-length-of-a-process-name
|
||||||
var file_buf: [16]u8 = undefined;
|
const proc_name = try utils.readFile(allocator, file, 16);
|
||||||
const read = try file.read(&file_buf);
|
defer allocator.free(proc_name);
|
||||||
const proc_name = file_buf[0..read];
|
|
||||||
|
|
||||||
const proc_name_trimmed = std.mem.trim(u8, proc_name, "\n");
|
const proc_name_trimmed = std.mem.trim(u8, proc_name, "\n");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user