summaryrefslogtreecommitdiff
path: root/userland/libc/stdio
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2023-11-24 21:47:28 +0100
committerAnton Kling <anton@kling.gg>2023-11-24 21:47:28 +0100
commite4aa83204502df229def8f1b639039dfa5fe33a1 (patch)
treebba452bc7238797dc6474ec5c5673f50e27a2dd3 /userland/libc/stdio
parent4764846cc2afe0e56f4490e3973b7322c2129e29 (diff)
LibC: Fill new allocations with random data and fix a bug
The bug was noticed as a result of this new randomization of allocations.
Diffstat (limited to 'userland/libc/stdio')
-rw-r--r--userland/libc/stdio/fopen.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/userland/libc/stdio/fopen.c b/userland/libc/stdio/fopen.c
index d31082d..71d14db 100644
--- a/userland/libc/stdio/fopen.c
+++ b/userland/libc/stdio/fopen.c
@@ -44,7 +44,7 @@ FILE *fopen(const char *pathname, const char *mode) {
struct stat s;
stat(pathname, &s);
- FILE *r = malloc(sizeof(FILE));
+ FILE *r = calloc(1, sizeof(FILE));
r->read = read_fd;
r->write = write_fd;
r->seek = seek_fd;