diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2021-10-24 02:53:27 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2021-10-24 03:10:03 +0200 |
| commit | 7af858caafc4b55535e97833cf21f63828335e2d (patch) | |
| tree | 9cfd8915dfab706fd6d4fd7e9e4a69c4311d1f48 | |
| parent | cbd551e8a326c56472f1423b298cd032711578a4 (diff) | |
Provide conforming interface for fwrite(3)
| -rw-r--r-- | libpsx/include/stdio.h | 2 | ||||
| -rw-r--r-- | 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 { |
