From: Ville Lundberg Newsgroups: comp.os.msdos.djgpp Subject: Segmentation fault in UNIX Date: Thu, 07 May 1998 14:37:41 +0300 Organization: Helsinki University of Technology Lines: 28 Distribution: inet Message-ID: <35519D05.18BA@cc.hut.fi> NNTP-Posting-Host: haapa.hut.fi Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Why does this simple piece of code cause a "Segmentation fault" in UNIX, while it works just fine in DOS? The error occurs when the code hits the getpass() function. #include #include #include void main(void) { char *lin, *pin; do { printf("Enter name and password:\n"); printf("Name:"); gets(lin); } while(strcmp(lin, "")==NULL); pin = getpass("Password:"); // And here's nothing more than opening a file and couple printf:s } =-----= 12) Pelimies ottaa napakympissa naäteimmäan tytoön. Ville Lundberg vlundber AT cc DOT hut DOT fi www.hut.fi/~vlundber/pelimiehet