Provide conforming interface for fwrite(3)

This commit is contained in:
Xavier Del Campo Romero 2021-10-24 02:53:27 +02:00
parent cbd551e8a3
commit 7af858caaf
2 changed files with 3 additions and 2 deletions

View File

@ -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);

View File

@ -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
{