Releasing debian version 5.00+dfsg-1.
[syslinux-debian/hramrach.git] / com32 / elflink / ldlinux / eprintf.c
blobf15edc6e4acbe8e396ad715a92c795f66befb75c
1 #include <stdio.h>
2 #include <string.h>
3 #include <stdarg.h>
4 #include <core.h>
6 #define BUFFER_SIZE 4096
8 static void veprintf(const char *format, va_list ap)
10 int rv, _rv;
11 char buffer[BUFFER_SIZE];
12 char *p;
14 _rv = rv = vsnprintf(buffer, BUFFER_SIZE, format, ap);
16 if (rv < 0)
17 return;
19 if (rv > BUFFER_SIZE - 1)
20 rv = BUFFER_SIZE - 1;
22 p = buffer;
23 while (rv--)
24 write_serial(*p++);
26 _fwrite(buffer, _rv, stdout);
29 void eprintf(const char *format, ...)
31 va_list ap;
33 va_start(ap, format);
34 veprintf(format, ap);
35 va_end(ap);