/* snprintf()
 *
 *  Formatted `print' to a string.
 */

#include "stdio.h"

char *
snprintf(n, s, fmt, args)
int n;				/* Length of string buffer */
char *s;			/* String buffer */
char *fmt;			/* Format string */
int args;			/* Used for pointer to the rest of the args */
{
    FILE fil;

    fil.f_count = n;
    fil.f_buf = s;
    _doprnt(fmt, &args, &fil);
    *(fil.f_buf) = '\0';
    return s;
}
