From 86b71bf2cecfba9f19442f0285fbbf1357e68e04 Mon Sep 17 00:00:00 2001 From: Kevin Wang Date: Mon, 24 Jun 2019 14:06:38 +0800 Subject: [PATCH] Fix calloc alloc wrong size --- builtin/builtin.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/builtin.v b/builtin/builtin.v index 168b213275..9d77cb4c0d 100644 --- a/builtin/builtin.v +++ b/builtin/builtin.v @@ -84,7 +84,7 @@ pub fn calloc(n int) byteptr { if n < 0 { panic('calloc(<0)') } - return C.calloc(sizeof(float) * n, sizeof(float)) + return C.calloc(n, 1) } fn _strlen(s byteptr) int {