On Sat, Jan 09, 2021 at 08:00:42AM +0100, Otto Moerbeek wrote:
> As reported on misc@
>
> https://marc.info/?l=openbsd-misc&m=161016188503894&w=2
ok tb
>
> -Otto
>
> Index: regular.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/cmp/regular.c,v
> retrieving revision 1.12
> diff -u -p -r1.12 regular.c
> --- regular.c 6 Feb 2015 23:21:59 -0000 1.12
> +++ regular.c 9 Jan 2021 06:53:20 -0000
> @@ -51,15 +51,15 @@ c_regular(int fd1, char *file1, off_t sk
> off_t byte, length, line;
> int dfound;
>
> - if (sflag && len1 != len2)
> - exit(1);
> -
> if (skip1 > len1)
> eofmsg(file1);
> len1 -= skip1;
> if (skip2 > len2)
> eofmsg(file2);
> len2 -= skip2;
> +
> + if (sflag && len1 != len2)
> + exit(1);
>
> length = MINIMUM(len1, len2);
> if (length > SIZE_MAX) {
>