Pristine Ack-5.5
[Ack-5.5.git] / modules / src / print / sprint.c
1 /*
2  * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
3  * See the copyright notice in the ACK home directory, in the file "Copyright".
4  */
5 /* $Id: sprint.c,v 1.9 1994/06/24 11:20:46 ceriel Exp $ */
6
7 #include <system.h>
8 #include "print.h"
9 #include "param.h"
10
11 /*FORMAT1v $
12         %s = char *
13         %l = long
14         %c = int
15         %[uxbo] = unsigned int
16         %d = int
17 $ */
18 /*VARARGS*/
19 char *
20 sprint
21 #if __STDC__
22         (char *buf, char *fmt, ...)
23 {
24 #else
25         (va_alist)
26         va_dcl
27 {
28         char *buf, *fmt;
29 #endif
30         va_list args;
31
32 #if __STDC__
33         va_start(args, fmt);
34 #else
35         va_start(args);
36         buf = va_arg(args, char *);
37         fmt = va_arg(args, char *);
38 #endif
39         buf[_format(buf, fmt, args)] = '\0';
40         va_end(args);
41         return buf;
42 }