Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!adm!nardacph@Hawaii-EMH.arpa From: nardacph@Hawaii-EMH.arpa Newsgroups: comp.lang.c Subject: Curses! Another Bug! Message-ID: <9828@brl-adm.ARPA> Date: Fri, 16-Oct-87 22:24:23 EDT Article-I.D.: brl-adm.9828 Posted: Fri Oct 16 22:24:23 1987 Date-Received: Sun, 18-Oct-87 05:46:12 EDT Sender: news@brl-adm.ARPA Lines: 42 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 ". 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