From 55b3a04e97b7ddd0db17a4fc3ba35461b106b92f Mon Sep 17 00:00:00 2001 From: dzwdz Date: Wed, 27 Jul 2022 12:27:48 +0200 Subject: user/libc: fseek() --- src/user/lib/elfload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/user/lib/elfload.c') diff --git a/src/user/lib/elfload.c b/src/user/lib/elfload.c index a471513..5ba596f 100644 --- a/src/user/lib/elfload.c +++ b/src/user/lib/elfload.c @@ -12,9 +12,9 @@ void elf_execf(FILE *f) { const size_t cap = 0x60000; size_t pos = 0; void *buf = malloc(cap); // TODO a way to get file size + fseek(f, 0, SEEK_SET); if (buf && fread(buf, 1, cap - pos, f)) elf_exec(buf); - free(buf); } -- cgit v1.2.3