Pristine Ack-5.5
[Ack-5.5.git] / lang / cem / libcc.ansi / stdio / vsprintf.c
1 /*
2  * vsprintf - print formatted output without ellipsis on an array
3  */
4 /* $Id: vsprintf.c,v 1.3 1994/06/24 11:52:06 ceriel Exp $ */
5
6 #include        <stdio.h>
7 #include        <stdarg.h>
8 #include        "loc_incl.h"
9
10 int
11 vsprintf(char *s, const char *format, va_list arg)
12 {
13         int retval;
14         FILE tmp_stream;
15
16         tmp_stream._fd     = -1;
17         tmp_stream._flags  = _IOWRITE + _IONBF + _IOWRITING;
18         tmp_stream._buf    = (unsigned char *) s;
19         tmp_stream._ptr    = (unsigned char *) s;
20         tmp_stream._count  = 32767;
21
22         retval = _doprnt(format, arg, &tmp_stream);
23         putc('\0',&tmp_stream);
24
25         return retval;
26 }