From 7af858caafc4b55535e97833cf21f63828335e2d Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Sun, 24 Oct 2021 02:53:27 +0200 Subject: [PATCH] Provide conforming interface for fwrite(3) --- libpsx/include/stdio.h | 2 +- libpsx/src/libc.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libpsx/include/stdio.h b/libpsx/include/stdio.h index c63e585..456a438 100644 --- a/libpsx/include/stdio.h +++ b/libpsx/include/stdio.h @@ -112,7 +112,7 @@ FILE *fdopen(int fildes, const char *mode); FILE *fopen(const char *path, const char *mode); int fclose(FILE *stream); int fread(void *ptr, int size, int nmemb, FILE *f); -int fwrite(void *ptr, int size, int nmemb, FILE *f); +size_t fwrite(void *ptr, size_t size, size_t nmemb, FILE *stream); int fgetc(FILE *f); int ftell(FILE *f); diff --git a/libpsx/src/libc.c b/libpsx/src/libc.c index 55ab413..d8aef26 100644 --- a/libpsx/src/libc.c +++ b/libpsx/src/libc.c @@ -649,7 +649,8 @@ int puts(const char *str) return EOF; } -int fwrite(void *ptr, int size, int nmemb, FILE *f) +size_t fwrite(void *restrict const ptr, const size_t size, const size_t nmemb, + FILE *restrict const f) { if(IS_CONS_OUT(f)) // stdout or stderr {