secondary cache feature in vm.
[minix.git] / lib / libc / stdio / vsprintf.c
blob7452a29e0f328ed4dd3cb5f4b5fb17cf1750a416
1 /*
2 * vsprintf - print formatted output without ellipsis on an array
3 */
4 /* $Header$ */
6 #include <stdio.h>
7 #include <stdarg.h>
8 #include <limits.h>
9 #include "loc_incl.h"
11 int
12 vsnprintf(char *s, size_t n, const char *format, va_list arg)
14 int retval;
15 FILE tmp_stream;
17 tmp_stream._fd = -1;
18 tmp_stream._flags = _IOWRITE + _IONBF + _IOWRITING;
19 tmp_stream._buf = (unsigned char *) s;
20 tmp_stream._ptr = (unsigned char *) s;
21 tmp_stream._count = n-1;
23 retval = _doprnt(format, arg, &tmp_stream);
24 tmp_stream._count = 1;
25 putc('\0',&tmp_stream);
27 return retval;
30 int
31 vsprintf(char *s, const char *format, va_list arg)
33 return vsnprintf(s, INT_MAX, format, arg);