Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uunet!unhd!psc90!pyr201 From: pyr201@psc90.UUCP (d^2) Newsgroups: comp.lang.c Subject: Novic C programmer needs help Message-ID: <1153@psc90.UUCP> Date: 11 Feb 90 03:34:30 GMT Reply-To: pyr201@.UUCP (d^2) Organization: Plymouth State College Lines: 32 Below is a piece of code used in the recently posted Tetris game. On our system, (BSD), this produces crap. Namely the last text output is kept forever in some buffer somewhere and it shows up in the integer output, ie, 15Press any key. I made some hacks to it, but I need to know what the library function _doprnt does or better yet what this function form() does. Can anyone answer this question for me? Thanks in advance. char *form (va_alist) va_dcl { va_list pvar; char *fmt_string; static char result[LINELEN]; FILE b; va_start (pvar); fmt_string = va_arg (pvar, char*); b._flag = _IOWRT|_IOSTRG; b._ptr = result; b._cnt = LINELEN; ---> _doprnt(fmt_string, pvar, &b); <--- putc('\0', &b); va_end (pvar); return (result); }