[comp.lang.c] Curses! Another Bug!

nardacph@Hawaii-EMH.arpa (10/17/87)

In a previous posting I listed a number of bugs in the version of
Curses published by Allen Holub in the July issue of DDJ.  The 
package requires a function called "doprnt()", which is not part
of the source code available on Compuserve or by mail from DDJ, but
is printed with the article.  Unfortunately there is a bug in the
MS-DOS version printed with the article.  Because it is a short 
routine, the corrected version follows:

-------------------------------------------------------------------

 
doprnt(ofunct, funct_arg, fmt, argp)
int     (*ofunct) ();
char    *funct_arg;
char    *fmt;
va_list *argp;
{
    /* A doprnt() for ANSI              */
    /* (c) 1987, Allen I. Holub         */
    /* Bug fix by C. F. Taylor          */
 
    char        buf[133], *p;
 
    vsprintf( buf, fmt, argp );
    for( p = buf; *p; (*ofunct)( *p++, funct_arg ) )
        ;
}
 
----------------------------------------------------------------------

It requires "#include <stdarg.h>".

Allen Holub has copyrighted his version of Curses.  His usual policy is
to allow private, non-commercial use of code he has published in a book
or magazine.

Charles Taylor
Navy Regional Data Automation Center
Box 140
Pearl Harbor, HI 96860
NARDACPH @ HAWAII-EMH.ARPA