From 43fb954234ce5fcb103b546d882c48b61f816fe8 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Sun, 4 Aug 2019 00:16:37 +0200 Subject: [PATCH] os: fix executable on FreeBSD and older C compilers --- vlib/os/os.v | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vlib/os/os.v b/vlib/os/os.v index 68a80f752a..8b457e941c 100644 --- a/vlib/os/os.v +++ b/vlib/os/os.v @@ -692,9 +692,9 @@ pub fn executable() string { } $if freebsd { mut result := malloc(MAX_PATH) - mut mib := [1 /* CTL_KERN */, 14 /* KERN_PROC */, 12 /* KERN_PROC_PATHNAME */, -1]!! + mib := [1 /* CTL_KERN */, 14 /* KERN_PROC */, 12 /* KERN_PROC_PATHNAME */, -1] size := MAX_PATH - C.sysctl(mib, 4, result, &size, 0, 0) + C.sysctl(mib.data, 4, result, &size, 0, 0) return string(result) } $if openbsd {