home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GEMini Atari
/
GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso
/
zip
/
mint
/
mntlib16.lzh
/
MNTLIB16
/
SPRINTF.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-08-03
|
836b
|
40 lines
#include <stdarg.h>
#include <stdio.h>
#include <limits.h>
#include "lib.h"
#if __STDC__
int sprintf(char *buf, const char *fmt, ...)
#else
int sprintf(buf, fmt) char *buf; const char *fmt;
#endif
{
va_list args;
register int n;
FILE sf =
{0L, (unsigned char *)buf, (unsigned char *)buf,
_IOWRT|_IOBIN|_IOSTRING|_IOFBF, 0, LONG_MAX,'\0'};
va_start(args, fmt);
n = _doprnt(&sf, fmt, args);
*(sf._ptr) = '\0'; /* always tie off the string */
va_end(args);
return(n);
}
int
vsprintf(buf, fmt, args)
char *buf;
const char *fmt;
va_list args;
{
register int n;
FILE sf =
{0L, (unsigned char *)buf, (unsigned char *)buf,
_IOWRT|_IOBIN|_IOSTRING|_IOFBF, 0, LONG_MAX,'\0'};
n = _doprnt(&sf, fmt, args);
*(sf._ptr) = '\0'; /* always tie of the string */
return(n);
}