vsprintf undefined

Soccer Stud kschnitz at puff.UUCP
Wed Jul 12 05:55:40 AEST 1989


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 my home-made varargs-based version of C++'s neat function of   *|
|*  the same name.  It saves all that tedious mucking about with static	   *|
|*  buffers which you sprintf into, then forget all about, by basically	   *|
|*  being a sprintf with its own statis storage.  It takes as arguments	   *|
|*  exactly the same things as printf(3), and returns a pointer to the	   *|
|*  resultant string.							   *|
|*									   *|
\***************************************************************************/

/*VARARGS*/
char *form (va_alist)
  va_dcl
{
  va_list pvar;
  char *fmt_string;
  static char result[LINELEN];
  
  va_start (pvar);
  fmt_string = va_arg (pvar, char*);
  (void) vsprintf (result, fmt_string, pvar);
  va_end (pvar);
  return (result);
}


-- 
Kevin Schnitzius     (Encore Computer Corporation, Ft. Lauderdale, Florida)
                     (formerly Gould CSD)
********************* Please ignore the From: line ************************
Uucp:      {pur-ee,sun,codas!novavax,uunet,mcnc!rti,etc}!gould!kschnitizius
Internet:   temporarily disconnected
                      What a bunch of typing, huh?



More information about the Comp.lang.c mailing list