fix(userspace/libc): fopen should set buffer_pos to -1

This change is a fix for fread() because it needs to pass the if statement: "if (stream->buffer_pos >= stream->buffer_size)"

Signed-off-by: EnderIce2 <enderice2@protonmail.com>
This commit is contained in:
EnderIce2 2025-02-22 02:43:06 +02:00
parent d7cbeb9eba
commit 74ff9579f3
No known key found for this signature in database
GPG Key ID: 2EE20AF089811A5A

View File

@ -217,7 +217,7 @@ export FILE *fopen(const char *restrict pathname, const char *restrict mode)
file->fd = fd;
file->buffer = malloc(4096);
file->buffer_size = 4096;
file->buffer_pos = 0;
file->buffer_pos = -1;
file->flags = flags;
file->error = 0;
file->eof = 0;