diff --git a/usr.bin/uudecode/uudecode.c b/usr.bin/uudecode/uudecode.c index 39a8cf650042..d3fef7aee120 100644 --- a/usr.bin/uudecode/uudecode.c +++ b/usr.bin/uudecode/uudecode.c @@ -255,7 +255,9 @@ decode2(flag) } } } - if (!fgets(buf, sizeof(buf), stdin) || strncmp(buf, "end", 3) || (buf[3] && buf[3] != '\n')) { + if (fgets(buf, sizeof(buf), stdin) == NULL || + (strcmp(buf, "end") && strcmp(buf, "end\n") && + strcmp(buf, "end\r\n"))) { (void)fprintf(stderr, "uudecode: %s: no \"end\" line.\n", filename); return(1);