From 436d643f23f9c0ce4657e6a86db6136ac205854a Mon Sep 17 00:00:00 2001 From: utox39 Date: Mon, 3 Mar 2025 01:37:13 +0100 Subject: [PATCH] chore: remove a magic number --- src/macos/macos.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/macos/macos.zig b/src/macos/macos.zig index 452567b..019a648 100644 --- a/src/macos/macos.zig +++ b/src/macos/macos.zig @@ -55,7 +55,7 @@ pub fn getSystemUptime() !SystemUptime { var uptime_ns: f64 = 0.0; var name = [_]c_int{ c_sysctl.CTL_KERN, c_sysctl.KERN_BOOTTIME }; - if (c_sysctl.sysctl(&name, 2, &boot_time, &size, null, 0) == 0) { + if (c_sysctl.sysctl(&name, name.len, &boot_time, &size, null, 0) == 0) { const boot_seconds = @as(f64, @floatFromInt(boot_time.tv_sec)); const now_seconds = @as(f64, @floatFromInt(std.time.timestamp())); uptime_ns = now_seconds - boot_seconds;