From f2773e05e5c718e8865fed31b2b7a5dc179c7635 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 26 Mar 2019 00:10:58 +0100 Subject: [PATCH] LibC: fread() should return the number of elements (not bytes) read. --- LibC/stdio.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LibC/stdio.cpp b/LibC/stdio.cpp index 5576795f6c..9a976b4bb1 100644 --- a/LibC/stdio.cpp +++ b/LibC/stdio.cpp @@ -208,7 +208,7 @@ size_t fread(void* ptr, size_t size, size_t nmemb, FILE* stream) return 0; if (nread == 0) stream->eof = true; - return nread; + return nread / size; } size_t fwrite(const void* ptr, size_t size, size_t nmemb, FILE* stream)