Files
Arquivotheca.Solaris-2.5/lib/libbc/libc/stdio/sys5/sprintf.c
seta75D 7c4988eac0 Init
2021-10-11 19:38:01 -03:00

29 lines
543 B
C
Executable File

#pragma ident "@(#)sprintf.c 1.7 92/07/20 SMI" /* from S5R2 1.5 */
/*LINTLIBRARY*/
#include <stdio.h>
#include <varargs.h>
#include <values.h>
extern int _doprnt();
/*VARARGS2*/
int
sprintf(string, format, va_alist)
char *string, *format;
va_dcl
{
register int count;
FILE siop;
va_list ap;
siop._cnt = MAXINT;
siop._base = siop._ptr = (unsigned char *)string;
siop._flag = _IOWRT+_IOSTRG;
va_start(ap);
count = _doprnt(format, ap, &siop);
va_end(ap);
*siop._ptr = '\0'; /* plant terminating null character */
return(count);
}