Problem reported by Josh Rickmar.
ok millert@
-/* $OpenBSD: diff3.c,v 1.64 2020/06/26 07:28:47 stsp Exp $ */
+/* $OpenBSD: diff3.c,v 1.65 2021/04/13 14:20:23 stsp Exp $ */
/*
* Copyright (C) Caldera International Inc. 2001-2002.
do {
c = getc(fp[0]);
d = getc(fp[1]);
+ if (c == -1 && d == -1)
+ break;
if (c == -1 || d== -1)
return (-1);
nchar++;
-/* $OpenBSD: diff3prog.c,v 1.20 2020/06/26 07:28:47 stsp Exp $ */
+/* $OpenBSD: diff3prog.c,v 1.21 2021/04/13 14:20:23 stsp Exp $ */
/*
* Copyright (C) Caldera International Inc. 2001-2002.
do {
c = getc(fp[0]);
d = getc(fp[1]);
+ if (c == -1 && d == -1)
+ break;
if (c == -1 || d== -1)
trouble();
nchar++;
-/* $OpenBSD: diff3.c,v 1.44 2020/06/26 07:28:46 stsp Exp $ */
+/* $OpenBSD: diff3.c,v 1.45 2021/04/13 14:20:24 stsp Exp $ */
/*
* Copyright (C) Caldera International Inc. 2001-2002.
do {
c = getc(fp[0]);
d = getc(fp[1]);
+ if (c == -1 && d == -1)
+ break;
if (c == -1 || d== -1)
return (-1);
nchar++;