We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 439921d commit a9983ebCopy full SHA for a9983eb
1 file changed
vlib/os/file.c.v
@@ -513,7 +513,7 @@ pub fn (mut f File) read_struct[T](mut t T) ! {
513
if tsize == 0 {
514
return error_size_of_type_0()
515
}
516
- nbytes := fread(t, 1, tsize, f.cfile)!
+ nbytes := fread(voidptr(&t), 1, tsize, f.cfile)!
517
if nbytes != tsize {
518
return error_with_code('incomplete struct read', nbytes)
519
@@ -530,7 +530,7 @@ pub fn (mut f File) read_struct_at[T](mut t T, pos u64) ! {
530
531
532
f.seek(pos, .start) or {}
533
534
f.seek(0, .end) or {}
535
536
0 commit comments