Provide implementation for fprintf(3)

This commit is contained in:
Xavier Del Campo Romero 2021-10-24 02:48:31 +02:00
parent fdf8c18335
commit 80beba98c7
2 changed files with 17 additions and 1 deletions

View File

@ -85,7 +85,7 @@ int puts(const char *str);
*/
extern int printf(const char *format, ...);
int fprintf(FILE *fd, const char *format, ...);
#ifdef __IN_LIBPSX

View File

@ -853,6 +853,22 @@ int vsprintf(char *string, const char *fmt, va_list ap)
return vsnprintf(string, 0xffffffff, fmt, ap);
}
int fprintf(FILE *const fd, const char *fmt, ...)
{
if (fd == stdout || fd == stderr)
{
int r;
va_list ap;
va_start(ap, fmt);
r = vprintf(fmt, ap);
va_end(ap);
return r;
}
return -1;
}
int sprintf(char *string, const char *fmt, ...)
{
int r;