feat+fix: add extern fns reading; fix VM reading issues
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include <common/fzl_extern.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -25,14 +26,14 @@ bool vm_rd_extern_libs(fzl_vm_reader_t *reader, FILE *fd)
|
||||
|
||||
memset(reader->extern_libs, 0, sizeof(char *) * libs_count);
|
||||
|
||||
bool ok = false;
|
||||
uint16_t name_sz = 0;
|
||||
bool ok = false;
|
||||
size_t name_sz = 0;
|
||||
char name[256];
|
||||
for (uint16_t i = 0; i < libs_count; i++)
|
||||
{
|
||||
memset(name, 0, sizeof(name));
|
||||
|
||||
ok = vm_rd_u16(fd, 1, &name_sz);
|
||||
ok = vm_rd_word(fd, 1, &name_sz);
|
||||
if (!ok || name_sz < 1)
|
||||
{
|
||||
snprintf(internal_error, sizeof(internal_error),
|
||||
|
||||
Reference in New Issue
Block a user