checker: do not allow &u8(0), force nil like we do with &Type(0)

This commit is contained in:
Alexander Medvednikov 2025-05-03 22:37:51 +03:00
parent 3ab660b4c6
commit 7d57a19d7e
52 changed files with 184 additions and 118 deletions

View file

@ -205,7 +205,7 @@ pub fn (mut zentry Zip) create_entry(name string) ! {
// NOTE: remember to release the memory allocated for an output buffer.
// for large entries, please take a look at zip_entry_extract function.
pub fn (mut zentry Zip) read_entry() !voidptr {
mut buf := &u8(0)
mut buf := &u8(unsafe { nil })
mut bsize := usize(0)
res := C.zip_entry_read(zentry, unsafe { &voidptr(&buf) }, &bsize)
if res == -1 {