Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!sunic!tut!santra!santra!jem From: jem@cs.hut.fi (Johan Myreen) Newsgroups: comp.os.minix Subject: Bug in crc.c Message-ID: Date: 26 Feb 90 19:30:30 GMT References: <1395@mountn.dec.com> <5673@star.cs.vu.nl> Sender: news@santra.uucp (Cnews - USENET news system) Organization: Helsinki University of Technology, Finland Lines: 22 In-Reply-To: ast@cs.vu.nl's message of 26 Feb 90 09:00:19 GMT In article <5673@star.cs.vu.nl> ast@cs.vu.nl (Andy Tanenbaum) writes: /* fragment of crc.c */ > else if (argc == 2 && strcmp(argv[1], "-") == 0) > while (fgets(line, sizeof line, stdin) != NULL) { > if (line[strlen(line) - 1] = '\n') > line[strlen(line) - 1] = '\0'; > crc(line); > } The line if (line[strlen(line) - 1] = '\n') should be if (line[strlen(line) - 1] == '\n') -- Johan Myreen jem@cs.hut.fi