view loadagent/libprintf/sprintf.c @ 3:45bf8af5f061

libprintf brought in from older PPC/m68k code, but fucking GCC refuses to compile <varargs.h> - need to convert to Anshit C <stdarg.h>
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Mon, 29 Apr 2013 07:00:22 +0000
parents
children 5c7b3d5d5702
line wrap: on
line source

#include <varargs.h>

extern void _sprintf_putchar();

int
sprintf(va_alist)
	va_dcl
{
	va_list ap;
	char *strptr;
	char *fmt;
	int len;

	va_start(ap);
	strptr = va_arg(ap, char *);
	fmt = va_arg(ap, char *);
	len = _doprnt(fmt, ap, &_sprintf_putchar, &strptr);
	*strptr = '\0';
	va_end(ap);
	return(len);
}