Skip to content

Commit

Permalink
fix memcpy parameters for fixed array
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyi98 committed Oct 3, 2024
1 parent 6b8d871 commit 848563e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vlib/v/gen/c/struct.v
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 848563e

Please sign in to comment.