Path: utzoo!mnetor!uunet!husc6!bloom-beacon!gatech!mcnc!rti!xyzzy!meissner From: meissner@xyzzy.UUCP (Usenet Administration) Newsgroups: comp.sources.games.bugs Subject: Re: omega woes Message-ID: <592@xyzzy.UUCP> Date: 3 Feb 88 14:49:47 GMT References: <32172@auc.UUCP> Reply-To: meissner@xyzzy.UUCP (Michael Meissner) Organization: Data General (Languages @ Research Triangle Park, NC.) Lines: 77 In article <32172@auc.UUCP> maw@auc.UUCP writes: | I have just compiled omega on an AT&T 3b15 running SYS V Rel | 2.1.2 of UNIX. When I tried to play the game, the screen was | filled with CTRL-? in inverse print. It occurs after the message | of the day screen is displayed. This is a common C portability bug. The problem is ofile.c uses a char variable to receive the value getc returns, and tests it against EOF. On a machine where char's are unsigned, this will never end the loop. If you change line 109 to be an int declaration instead of char it will work. I also changed the call of printw to print a single character to use the faster addch. If you have patch, you can feed this article to patch to change the file. *** ofile.c.old Wed Feb 3 09:41:33 1988 --- ofile.c Sat Jan 23 22:18:12 1988 *************** *** 106,112 void showfile(fd) FILE *fd; { ! char c,d=' '; int x,y; clear(); refresh(); --- 106,112 ----- void showfile(fd) FILE *fd; { ! int c,d=' '; int x,y; clear(); refresh(); *************** *** 110,116 int x,y; clear(); refresh(); ! c = fgetc(fd); while ((c != EOF)&&(d != 'q')&&(d!=ESCAPE)) { getyx(stdscr,y,x); if (y > 20) { --- 110,116 ----- int x,y; clear(); refresh(); ! c = getc(fd); while ((c != EOF)&&(d != 'q')&&(d!=ESCAPE)) { getyx(stdscr,y,x); if (y > 20) { *************** *** 119,126 d = wgetch(stdscr); clear(); } ! printw("%c",c); ! c = fgetc(fd); } if ((d != 'q')&&(d!=ESCAPE)) { printw("\n-Done-"); --- 119,126 ----- d = wgetch(stdscr); clear(); } ! addch(c); ! c = getc(fd); } if ((d != 'q')&&(d!=ESCAPE)) { printw("\n-Done-"); -- Michael Meissner, Data General. Uucp: ...!mcnc!rti!xyzzy!meissner Arpa/Csnet: meissner@dg-rtp.DG.COM