diff options
Diffstat (limited to 'payloads/libpayload/libc/printf.c')
-rw-r--r-- | payloads/libpayload/libc/printf.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/payloads/libpayload/libc/printf.c b/payloads/libpayload/libc/printf.c index 04d39319bc..a1ebb14092 100644 --- a/payloads/libpayload/libc/printf.c +++ b/payloads/libpayload/libc/printf.c @@ -723,6 +723,20 @@ int sprintf(char *str, const char *fmt, ...) return ret; } +int fprintf(FILE *file, const char *fmt, ...) +{ + int ret; + if ((file == stdout) || (file == stderr)) { + va_list args; + va_start(args, fmt); + ret = vprintf(fmt, args); + va_end(args); + + return ret; + } + return -1; +} + struct vsnprintf_data { size_t size; /* Total space for string */ size_t len; /* Count of currently used characters */ |