memdisk: Force ld output format to 32-bits
[syslinux.git] / com32 / lib / vfprintf.c
blobbe084216b763066710e97e90f67a57970e2073b8
1 /*
2 * vfprintf.c
3 */
5 #include <stdio.h>
6 #include <string.h>
7 #include <stdarg.h>
8 #include <unistd.h>
10 #define BUFFER_SIZE 32768
12 int vfprintf(FILE * file, const char *format, va_list ap)
14 int rv;
15 char buffer[BUFFER_SIZE];
17 rv = vsnprintf(buffer, BUFFER_SIZE, format, ap);
19 if (rv < 0)
20 return rv;
22 if (rv > BUFFER_SIZE - 1)
23 rv = BUFFER_SIZE - 1;
25 return _fwrite(buffer, rv, file);