source: bootcd/isolinux/syslinux-6.03/com32/lib/vfprintf.c

Last change on this file was e16e8f2, checked in by Edwin Eefting <edwin@datux.nl>, 3 years ago

bootstuff

  • Property mode set to 100644
File size: 409 bytes
Line 
1/*
2 * vfprintf.c
3 */
4
5#include <stdio.h>
6#include <string.h>
7#include <stdarg.h>
8#include <unistd.h>
9
10#define BUFFER_SIZE     32768
11
12int vfprintf(FILE * file, const char *format, va_list ap)
13{
14    int rv;
15    char buffer[BUFFER_SIZE];
16
17    rv = vsnprintf(buffer, BUFFER_SIZE, format, ap);
18
19    if (rv < 0)
20        return rv;
21
22    if (rv > BUFFER_SIZE - 1)
23        rv = BUFFER_SIZE - 1;
24
25    return _fwrite(buffer, rv, file);
26}
Note: See TracBrowser for help on using the repository browser.