Path: utzoo!attcan!uunet!mcvax!kth!draken!liuida!prosys!ath From: ath@helios.prosys.se (Anders Thulin) Newsgroups: comp.sources.games.bugs Subject: Re: tetrix INIT_PAUSE Message-ID: <397@helios.prosys.se> Date: 11 Mar 89 12:37:39 GMT References: <204@sabin.UUCP> <1816@viscous.sco.COM> <14235@elroy.Jpl.Nasa.Gov> <1085@ur-cc.UUCP> Organization: Programsystem AB, Linkoping, SWEDEN Lines: 26 In article <1085@ur-cc.UUCP> lmna_cif@uhura.cc.rochester.edu (Louis Nau) writes: >In article <14235@elroy.Jpl.Nasa.Gov> dave%jplopto@jpl-mil.jpl.nasa.gov writes: >>OK, tetris gives me a segmentation fault when I try to run it. >>What's the problem? > I too have the same problem. Could someone please either post >or mail me as to why it does this? It compiles without any problem, but >just dumps core when run. I am trying to run it on a Sun 3/280S with SunOS. >Thanks for any help you can give. I really want to run this game. A short wrestle with a debugger on a Sun3/60 shows that it is strcpy() that dies. The buggy code can be found early in main(): : /* if the user has set an environment variable "TETRIS" then process it */ : : if(argc<2 && getenv("TETRIS") == NULL) { : [ ... ] : strcpy(tetrisenv, getenv("TETRIS")); Just change '==' to '!=' -- 15th commandment: thou shalt not invoke strcpy() with a NULL source string. -- Anders Thulin INET : ath@prosys.se ProgramSystem AB UUCP : ...!{uunet,mcvax}!enea!prosys!ath Teknikringen 2A PHONE: +46 (0)13 21 40 40 S-583 30 Linkoping, Sweden FAX : +46 (0)13 21 36 35