aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHimbeer <himbeer@disroot.org>2024-07-31 15:41:38 +0200
committerHimbeer <himbeer@disroot.org>2024-07-31 15:41:38 +0200
commit922fc9225efbe99a5f765dcd5b921149198e94e8 (patch)
treef24360de42f6c63ba2ba828aeed79608067e0305
parentee59520dbf725718fcd5bc6bec99645f08bbd1dd (diff)
root: Fix 'registers' variable being created with wrong length
-rw-r--r--src/root.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/root.zig b/src/root.zig
index a8cc12c..70ddf12 100644
--- a/src/root.zig
+++ b/src/root.zig
@@ -15,7 +15,7 @@ const Result = struct {
const SyscallError = error{Kernel};
fn ecall(number: usize, args: anytype) Result {
- comptime var registers = [max_args]usize{0};
+ comptime var registers = [max_args]usize{0} ** max_args;
inline for (args, 0..) |arg, i| {
if (i >= max_args) @compileError("Too many arguments to system call");
registers[i] = @bitCast(arg);