From 848563e70919a6bc74c7d48bcbd67cbe31940882 Mon Sep 17 00:00:00 2001 From: yuyi Date: Thu, 3 Oct 2024 13:11:25 +0800 Subject: [PATCH] fix memcpy parameters for fixed array --- vlib/v/gen/c/struct.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vlib/v/gen/c/struct.v b/vlib/v/gen/c/struct.v index f3def6e0837c65..b641292893c336 100644 --- a/vlib/v/gen/c/struct.v +++ b/vlib/v/gen/c/struct.v @@ -457,7 +457,7 @@ fn (mut g Gen) zero_struct_field(field ast.StructField) bool { g.empty_line = true styp := g.typ(field.typ) g.writeln('${styp} ${tmp_var} = {0};') - g.write('memcpy(&${tmp_var}, &') + g.write('memcpy(${tmp_var}, ') g.expr(field.default_expr) g.writeln(', sizeof(${styp}));') g.empty_line = false