/*		Q/C V3.2 Utility Library		*/
/*     Copyright (c) 1984 Quality Computer Systems	*/
/*			11/25/84			*/

#include "stdio.h"

/* format a string */
sprintf(nargs)
	{
	int _cat();		/* function _fmt will use as output */
	register *p;
	register char *s;

	p = &nargs + nargs;	/* address of first arg (string) */
	s = *p; 		/* point to the string */
	*s = '\0';		/* initialize the string */
	_fmt(_cat, s, p - 1);
	}
/* add a character to the end of a string (internal routine for sprintf) */
_cat(c, s)
char c, *s;
	{
	while (*s++)
		;		/* find end of string */
	*(s - 1) = c;		/* add c at old end */
	*s = '\0';		/* new end of string */
	}

