vsprintf undefined

Chet Ramey chet at kiwi.CWRU.EDU
Thu Jul 13 00:31:58 AEST 1989


In article <3171 at puff.UUCP> kschnitz at puff.UUCP (Soccer Stud) writes:
>
>Help!  This function came with the tetris game I got for Unix based
>machines.  The problem is vsprintf is undefined using my C libraries.
>
>Does anyone have a simple solution?  Please post the answer because
>others have had the same problem.  Thanks in advance.
>

This is the version of vsprintf that appears on uunet as part of the 
4.3-tahoe freed files.

#include <stdio.h>
#include <varargs.h>

int
vsprintf(str, fmt, ap)
	char *str, *fmt;
	va_list ap;
{
	FILE f;
	int len;

	f._flag = _IOWRT+_IOSTRG;
	f._ptr = str;
	f._cnt = 32767;
	len = _doprnt(fmt, ap, &f);
	*f._ptr = 0;
	return (len);
}

Chet Ramey			"We are preparing to think about contemplating 
Network Services Group, CWRU	 preliminary work on plans to develop a
chet at cwjcc.INS.CWRU.Edu		 schedule for producing the 10th Edition of 
				 the Unix Programmers Manual." -- Andrew Hume



More information about the Comp.lang.c mailing list