Path: utzoo!attcan!uunet!mcvax!enea!front.se!zap From: zap@front.se (Svante Lindahl) Newsgroups: comp.sources.d Subject: Re: tetris game (BSD Version) Keywords: Errors; How to get it working? Message-ID: <397@front.se> Date: 18 Mar 89 22:44:28 GMT References: <415@pai.UUCP> Organization: Front Capital Systems, Stockholm, Sweden Lines: 34 In article <415@pai.UUCP>, erc@pai.UUCP (Eric Johnson) writes: > 1)Running tetris alone without any command-line arguments dumps core, > for a segmentation fault (i.e., memory address error). Any ideas > why? A suggestion: if not enough (e.g., none) command-line > options are provided, how about printing an error message (to stderr) > and explaining why there is a problem? This is a because of a bug in main.c. Fix enclosed. Other than that, and making sure there is a score file in place, it seems to run fine on my Sun-3 (SunOS 3.5.2), although I've only tried it twice (not fun enough at 2400 baud). Svante *** main.c.~1~ Sat Mar 18 22:31:21 1989 --- main.c Sat Mar 18 23:12:47 1989 *************** *** 70,76 **** /* if the user has set an environment variable "TETRIS" then process it */ ! if(argc<2 && getenv("TETRIS") == NULL) { i=0, j=0, k=0; strcpy(tetrisenv, getenv("TETRIS")); --- 70,76 ---- /* if the user has set an environment variable "TETRIS" then process it */ ! if(argc<2 && getenv("TETRIS") != NULL) { i=0, j=0, k=0; strcpy(tetrisenv, getenv("TETRIS"));