[comp.os.minix] Bug in crc.c

jem@cs.hut.fi (Johan Myreen) (02/27/90)

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