Xref: utzoo comp.sources.games.bugs:895 comp.lang.c:19869 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!cwjcc!kiwi!chet From: chet@kiwi.CWRU.EDU (Chet Ramey) Newsgroups: comp.sources.games.bugs,comp.lang.c Subject: Re: vsprintf undefined Keywords: vsprintf varargs Message-ID: <411@cwjcc.CWRU.Edu> Date: 12 Jul 89 14:31:58 GMT References: <3171@puff.UUCP> Sender: news@cwjcc.CWRU.Edu Reply-To: chet@kiwi.CWRU.EDU (Chet Ramey) Followup-To: comp.sources.games.bugs Organization: CWRU Andrew R. Jennings Computing Center Lines: 35 In article <3171@puff.UUCP> kschnitz@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 #include 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@cwjcc.INS.CWRU.Edu schedule for producing the 10th Edition of the Unix Programmers Manual." -- Andrew Hume