diff options
author | 2021-01-09 09:58:12 +0000 | |
---|---|---|
committer | 2021-01-09 09:58:12 +0000 | |
commit | 20ca40a427324bcb9b2b5f7bf92a21b99ebdc224 (patch) | |
tree | eaf7ba7a462c4f265c88182e3d08f6265900f43e /usr.bin/cmp/regular.c | |
parent | Add 'strip' directive (diff) | |
download | wireguard-openbsd-20ca40a427324bcb9b2b5f7bf92a21b99ebdc224.tar.xz wireguard-openbsd-20ca40a427324bcb9b2b5f7bf92a21b99ebdc224.zip |
Move a premature optimization so that -s with offsets works.
ok florian@ tb@
Diffstat (limited to 'usr.bin/cmp/regular.c')
-rw-r--r-- | usr.bin/cmp/regular.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/cmp/regular.c b/usr.bin/cmp/regular.c index fb452f63758..a75cb18303a 100644 --- a/usr.bin/cmp/regular.c +++ b/usr.bin/cmp/regular.c @@ -1,4 +1,4 @@ -/* $OpenBSD: regular.c,v 1.12 2015/02/06 23:21:59 millert Exp $ */ +/* $OpenBSD: regular.c,v 1.13 2021/01/09 09:58:12 otto Exp $ */ /* $NetBSD: regular.c,v 1.2 1995/09/08 03:22:59 tls Exp $ */ /*- @@ -51,9 +51,6 @@ c_regular(int fd1, char *file1, off_t skip1, off_t len1, off_t byte, length, line; int dfound; - if (sflag && len1 != len2) - exit(1); - if (skip1 > len1) eofmsg(file1); len1 -= skip1; @@ -61,6 +58,9 @@ c_regular(int fd1, char *file1, off_t skip1, off_t len1, eofmsg(file2); len2 -= skip2; + if (sflag && len1 != len2) + exit(1); + length = MINIMUM(len1, len2); if (length > SIZE_MAX) { mmap_failed: |